This object is in archive! 
sample code to launch Locus intent
Answered
Hello Menion
Could you provide quick sample code to integrate in my android app in order to launch directly Locus as intent centered on a POI point (given by the intent : geo:lat,lon)?
I have found various information but not a specific code to launch only Locus.
Thank you !
Hi,
there are generally two ways, where depend what you want to do. If you want just display point on map, you may use simple method.
By simple I mean creating common intent as you probably do with geo data. But also set class name that should start this intent by
I've not tried it, but it should work. If you want to start Locus Pro, just use "menion.android.locus.pro" package name.
Second, more complicated way is to use existing Locus API, which allows a lot more, but it depend if you need it.
Let me know if it works or if you need more precise information
Hi,
there are generally two ways, where depend what you want to do. If you want just display point on map, you may use simple method.
By simple I mean creating common intent as you probably do with geo data. But also set class name that should start this intent by
I've not tried it, but it should work. If you want to start Locus Pro, just use "menion.android.locus.pro" package name.
Second, more complicated way is to use existing Locus API, which allows a lot more, but it depend if you need it.
Let me know if it works or if you need more precise information
Thank you Menion !
I have two more questions :
1. how can I check that Locus or Locus Pro is intalled on the smartphone ?
I have found following example on the web :
List<ResolveInfo> list = getPackageManager().queryIntentActivities(intent,
PackageManager.MATCH_DEFAULT_ONLY);
return list.size() > 0;
}
2. Api
I have found LOCUS Api in Google Code, is is the latest API ? : https://code.google.com/p/android-locus-map/
Thank you Menion !
I have two more questions :
1. how can I check that Locus or Locus Pro is intalled on the smartphone ?
I have found following example on the web :
List<ResolveInfo> list = getPackageManager().queryIntentActivities(intent,
PackageManager.MATCH_DEFAULT_ONLY);
return list.size() > 0;
}
2. Api
I have found LOCUS Api in Google Code, is is the latest API ? : https://code.google.com/p/android-locus-map/
Sure, you're welcome.
Code you wrote seems to be correct. With this method, you may simply check if exists any application that may handle intent parameter. So if you specify ClassName as I wrote in previous post, you may check if specific verison of Locus is installed.
2. Yes, it's correct. Just yesterday I pushed bigger update with some changes. Anyway all features to check if Locus is installed are already in API. Like here https://code.google.com/p/android-locus-map/source/browse/src/locus/api/android/utils/LocusUtils.java?repo=locus-api-android#320
Sure, you're welcome.
Code you wrote seems to be correct. With this method, you may simply check if exists any application that may handle intent parameter. So if you specify ClassName as I wrote in previous post, you may check if specific verison of Locus is installed.
2. Yes, it's correct. Just yesterday I pushed bigger update with some changes. Anyway all features to check if Locus is installed are already in API. Like here https://code.google.com/p/android-locus-map/source/browse/src/locus/api/android/utils/LocusUtils.java?repo=locus-api-android#320
Thank you for the support .
Concerning the intent and the "pro" or "non pro" version, is the activity name the same ?
PRO : is this correct ?
or this ?
NON PRO :
Thank you for the support .
Concerning the intent and the "pro" or "non pro" version, is the activity name the same ?
PRO : is this correct ?
or this ?
NON PRO :
I'm stupid, really sorry. I never called Locus in this was so I completely forget, that package of MainActivity is same for all versions.
It's com.asamm.locus.core.MainActivity
I'm stupid, really sorry. I never called Locus in this was so I completely forget, that package of MainActivity is same for all versions.
It's com.asamm.locus.core.MainActivity
OK. It is better now .... :-)
I have tried the following and it works :
OK. It is better now .... :-)
I have tried the following and it works :
Going now further .... I have tried to use OsmDroid to display maps and elements inside my application, but it is not stable enough and some regression appear with new version.....
So, is it possible to use Locus as "map engine" and integrate Locus map views inside my own application ?
Going now further .... I have tried to use OsmDroid to display maps and elements inside my application, but it is not stable enough and some regression appear with new version.....
So, is it possible to use Locus as "map engine" and integrate Locus map views inside my own application ?
Unfortunately no, it's currently not possible.
Locus map engine is not a completely separate library and I currently do not plan to publish it under any free license, sorry.
EDIT: Anyway I suggest to try MapsForge library, which part I also use in Locus and which seems to be quite stable and fully working. So give it a try.
Unfortunately no, it's currently not possible.
Locus map engine is not a completely separate library and I currently do not plan to publish it under any free license, sorry.
EDIT: Anyway I suggest to try MapsForge library, which part I also use in Locus and which seems to be quite stable and fully working. So give it a try.
Replies have been locked on this page!