Hi Abdullahi,
thank you for your kind reply.
It's very unbelievable but now it works and I really don't know why. I've left the project this morning and mixare loaded all the pois from my server: they didn't have object_url member at that moment; I launched it in the afternoon and it wasn't able to load any poi from my server any more. So I tried to add object_url in my json objects and then it loaded the pictures I had chosen for the pois.
So, the trouble about pois icon it seems solved.
However, I still have some problems:
1) The first time I launch the app it starts in the right way. If I close it with back button and I relaunch it, it crashes with this error:
12-12 16:03:46.369: E/AndroidRuntime(4190): java.lang.RuntimeException: Unable to destroy activity {org.mixare/org.mixare.PluginLoaderActivity}: java.lang.IllegalArgumentException: Service not registered: org.mixare.plugin.connection.DataHandlerServiceConnection@4051d650
12-12 16:03:46.369: E/AndroidRuntime(4190): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:2676)
12-12 16:03:46.369: E/AndroidRuntime(4190): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:2694)
12-12 16:03:46.369: E/AndroidRuntime(4190): at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:2810)
12-12 16:03:46.369: E/AndroidRuntime(4190): at android.app.ActivityThread.access$1600(ActivityThread.java:117)
12-12 16:03:46.369: E/AndroidRuntime(4190): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
12-12 16:03:46.369: E/AndroidRuntime(4190): at android.os.Handler.dispatchMessage(Handler.java:99)
12-12 16:03:46.369: E/AndroidRuntime(4190): at android.os.Looper.loop(Looper.java:123)
12-12 16:03:46.369: E/AndroidRuntime(4190): at android.app.ActivityThread.main(ActivityThread.java:3729)
12-12 16:03:46.369: E/AndroidRuntime(4190): at java.lang.reflect.Method.invokeNative(Native Method)
12-12 16:03:46.369: E/AndroidRuntime(4190): at java.lang.reflect.Method.invoke(Method.java:507)
12-12 16:03:46.369: E/AndroidRuntime(4190): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:874)
12-12 16:03:46.369: E/AndroidRuntime(4190): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:632)
12-12 16:03:46.369: E/AndroidRuntime(4190): at dalvik.system.NativeStart.main(Native Method)
12-12 16:03:46.369: E/AndroidRuntime(4190): Caused by: java.lang.IllegalArgumentException: Service not registered: org.mixare.plugin.connection.DataHandlerServiceConnection@4051d650
12-12 16:03:46.369: E/AndroidRuntime(4190): at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:891)
12-12 16:03:46.369: E/AndroidRuntime(4190): at android.app.ContextImpl.unbindService(ContextImpl.java:912)
12-12 16:03:46.369: E/AndroidRuntime(4190): at android.content.ContextWrapper.unbindService(ContextWrapper.java:352)
12-12 16:03:46.369: E/AndroidRuntime(4190): at org.mixare.plugin.PluginLoader.unBindServices(PluginLoader.java:106)
12-12 16:03:46.369: E/AndroidRuntime(4190): at org.mixare.PluginLoaderActivity.onDestroy(PluginLoaderActivity.java:116)
12-12 16:03:46.369: E/AndroidRuntime(4190): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:2663)
and it says "Unexpected interruption of application NameOfTheApplication (processorg.mixare). Retry." in a dialog on the smartphone.
So I press OK and if I launch the app again it starts correctly. It crashes and it works one after the other.
How can I solve it? ( I didn't change PluginLoaderActivity.java)
2) I need to open an activity with some poi details like a description, some web links, etc. ( I keep those details in the json object) when the user clicks on a POI instead of opening the url in the browser.
I managed to open the activity due to the click but it doesn't set the extras contents. For example, I tried adding a description and a weburls string to the POI:
a) I changed ArenaProcessor adding the following lines:
ma.setExtras("description", jo.getString("description"));
ma.setExtras("webUrls", "provaweburls");
b) I modified ImageMarker adding
@Override
public void setExtras(String name,String value)
{
if(name.equals("description"))
{
description=value;
Log.v("ImageMarker","Settata description: "+description);
}
if(name.equals("webUrls"))
{
webUrls=value;
Log.v("ImageMarker","Settati weburls: "+webUrls);
}
}
and I added the same code also in PluginMarker where I declared another attribute called description because in fClick() method I create a new POIClickHandler(title,ID,description,webUrls,URL, active, txtLab, signMarker, cMarker) instead of the basic ClickHandler
where POIClickHandler is a class made by me that extends ClickHandler. Here is its method handleClick:
public boolean handleClick(float x, float y, MixContextInterface ctx, MixStateInterface state){
if(super.isClickValid(x, y)){
Log.v("POIClickHandler","handleClick: CLICK IS VALID");
Log.v("POIClickHandler","IDPOI: "+idPOI+" description: "+description+" webUrls"+webUrls);
return state.handleEvent(ctx, idPOI, title, description, webUrls);
}
return false;
}
The method state.handleEvent(ctx, idPOI, title, description, webUrls) works because I tested it with LocalMarker after I had updated MixContextInterface and MixStateInterface in the library.
The Log in handleClick inside POIClickHandler shows me that description and webUrls are NULL! So setExtras in ImageMarker and PluginMarker doesn't work.
Where did I miss? Is there a simpler way to add some fields to ImageMarker without changing files in the library?
3) I see the edge of the POI label sometimes red and sometimes white. What does it depend on?
What is the clicks priority policy? What does it check in isClickValid method?
Sometimes my clicks on some pois are ignored and I can't understand why, if I relaunch the app it works again.
Thank you very much for your availability.
Shahry