My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
UseCasesExplanation  

Featured, Platform-Android
Updated Jan 20, 2011 by mixare.org

This page explains the different use-cases as shown on the website: http://www.mixare.org/usage/

Use case 1, 2 and 3:

Mixare is able to parse data in a specific format documented here ( http://code.google.com/p/mixare/wiki/DisplayYourOwnData ) both from online sources or from the filesystem using the standard android mechanism like:

Example for online resources:

Intent i = new Intent(); 
i.setAction(Intent.ACTION_VIEW); 
i.setDataAndType(Uri.parse("http://your_server/JSONEndpoint"), 
"application/mixare-json"); 
startActivity(i); 

Example for locally-stored file:

Intent i = new Intent(); 
i.setAction(Intent.ACTION_VIEW); 
i.setDataAndType(Uri.parse("content://com.android.htmlfileprovider/sdcard/Y OUR-JSON-FILENAME"), 
"application/mixare-json"); 
startActivity(i); 

The above examples cover use-case 3 of mixare, if you put the above code in your application it will launch mixare and it will just work. You do not have to worry about GPS initialization and further details, as mixare will take care of that and display the points. Use case number 2 is just the same, you just have to ensure that you webpage contains a link with the appropriate mime-type (application/mixare-json) and mixare will be launched.

Right now this is the only supported way to get data in mixare (unless you go for option 4). There is no way (right now) to push a list of places in the app for you application but using the methods explained above.

We thought that this was the most meaningful approach as it allows even non-programmers to use mixare as an augmented reality engine. This approach also allow the development of closed source launchers that interacts with mixare through this URI pass. This is what we did with our own apps , since it allowed us to keep our data private. If you think that other approaches would be better, please answer here or propose you idea in another thread! We would be delighted to hear your ideas or proposals.

About use-case number 4:

!IMPORTANT: Please remember that since mixare itself is GPLv3, any application that is developed on mixare using approach 4 has to be released as GPLv3!

Use-case 4 is meant to build a completely autonomous application based on top of mixare. We received some feedbacks asking how to embed the application in other existing ones. As stated above, right now this is not possible unless you rewrite some of the code of mixare itself. Some directions about how to do this follow:

How to change the JSON parsing (to support additional data formats:

See the file https://github.com/mixare/mixare/blob/master/src/org/mixare/data/Json.java

How to had-code some test data places in mixare for testing purposes:

See the same file above, basically you have to set the properties of each Marker's PhysicalPlace (mGeoLoc) object using setLatitude, setLongitude and setAltitude.

We hope this pointers will help you getting more from mixare.

Comment by project member mixare.org, Jan 20, 2011

whoops, done. Thanks Jonas!

Comment by rassall....@gmail.com, Mar 3, 2011

ok..I put these coding inside case 1: (package.org.mixture) sych that:

public boolean onOptionsItemSelected(MenuItem? item){

switch(item.getItemId()){
case 1:

Intent i = new Intent(); i.setAction(Intent.ACTION_VIEW); i.setDataAndType(Uri.parse("content://com.android.htmlfileprovider/sdcard/places.php"), "application/mixare-json"); startActivity(i); break;

}

so After open mixare, if i press datasource menu this activity start but shows "error loading places.php" on real time image. Though I already copy places.php in sdcard. So what's the problem. please help.

Comment by hbbla...@gmail.com, Mar 29, 2011

Weird,

How does my data know the lat, lon and search radius to lookup points in my database? When mixare calls the URL on my server does it pass these?

If not, how can I calculate distance?

The documentation is nor very good unfortunately.

Comment by matteo.m...@gmail.com, Aug 22, 2011

I experienced some issue with the following line:

i.setDataAndType(Uri.parse("content:// ...

and getting an "Error while loading" message in the application, while on the console

java.lang.SecurityException: Permission Denial: opening provider com.android.htmlviewer.FileContentProvider from ProcessRecord{2b32b358 19708:org.mixare/10124} (...) requires null or null

then after some (very time intensive!) debugging and search, it would appear like the 'content' protocol does not work any longer with Android 2.3.3 For example see below

http://code.google.com/p/android/issues/detail?id=2454#c35

Then, I experienced that the 'file:///sdcard' is working OK with Android 2.3.3, for instance my line of code is:

i.setDataAndType(Uri.parse("file:///sdcard/THISISMYFILE.JSON"), "application/mixare-json");

thought worthy to let you know! Ciao

Comment by ravi.sha...@ongraph.com, Oct 4, 2012

This link(https://github.com/mixare/mixare/blob/master/src/org/mixare/data/Json.java) is not working please provide a updated one.

Powered by Google Project Hosting