Hi,

Now, the mock location provider is running without exception, but the
latitude and longitude are shown as 0
 
Location[mProvider=test1,mTime=1210074935586,mLatitude=0.0,mLongitude=0.0,mHasAltitude=false,mAltitude=0.0,mHasBearing=false,mBearing=0.0,mHasSpeed=false,mSpeed=0.0,mExtras=null]

i create one kml file and pushed the properties file to the mock
location provider, kml file is

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2";>
  <Placemark>
    <name>Chennai</name>
    <description>Capital of Tamil Nadu</description>
    <Point>
      <coordinates>80.2475125425683,13.17883790140251,0</coordinates>
    </Point>
  </Placemark>
</kml>

here, i gave the co-ordinates as 80 and 37 but not showing that just 0
only,

please tell , where i'm going wrong.

the code is,
myLocationManager =
(LocationManager)getSystemService(Context.LOCATION_SERVICE);
        lpObj = myLocationManager.getProvider("mobeegal");
        loc =  myLocationManager.getCurrentLocation(lpObj.getName());
       tv = new TextView(this);
        tv.setText(loc.toString());
        setContentView(tv);

thanks.


On May 6, 9:31 am, scorpio <[EMAIL PROTECTED]> wrote:
> Thanks megha,
>
> What i did is,
> 1. i created a folder gps1 in data/misc/location
> 2. I changed the latitude and longitude in nmea file from 37 and -122
> to 13 and 80.
> 3. pushed 3 files (location, nmea and properties, as in "gps").
>
> then i tried these statements
>
> myLocationManager =
> (LocationManager)getSystemService(Context.LOCATION_SERVICE);
> lpObj = myLocationManager.getProvider("gps1");
> loc =  myLocationManager.getCurrentLocation(lpObj.getName());
> i = myLocationManager.getProviderStatus(lpObj.getName());
>
> but, the line lpObj = myLocationManager.getProvider("gps1");   caught
> illegal argument exception, what i'm doing wrong
> please help.........
>
> On May 5, 11:36 pm, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > Can you list the steps that you followed? There may be some error in your
> > location provider setup, but I need more information to find that. This
> > thread might also help 
> > you:http://groups.google.com/group/android-beginners/browse_thread/thread...
> > And here's the link to the documentation for creating mock location
> > providers:http://code.google.com/android/toolbox/apis/lbs.html
>
> > Based on your experience let us know, if we could add anything specific to
> > the documentation for mock providers to make it easier to follow.
>
> > Thanks,
> > Megha
>
> > On Mon, May 5, 2008 at 3:06 AM, scorpio <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
>
> > > i created a mock location provider gps1, and
>
> > >  myLocationManager =
> > > (LocationManager)getSystemService(Context.LOCATION_SERVICE);
> > >  lpObj = myLocationManager.getProvider("gps1");
>
> > > DEBUG/(13685): zip_openZipFile(/data/app/LocationManager1.apk)
> > > DEBUG/LocationManager(13685): getProvider: name = gps1
> > > DEBUG/LocationManagerService(508): getProviderInfo: provider = gps1
> > > DEBUG/LocationManagerService(508): loadProviders
> > > DEBUG/LocationManagerService(508): loadProviders: already loaded
> > > DEBUG/dalvikvm(508): Exception Ljava/lang/IllegalArgumentException;
> > > from LocationManagerService.java:649 not caught locally
> > > ERROR/JavaBinder(508): *** Uncaught remote exception!  (Exceptions are
> > > not yet supported across processes.)
> > > ERROR/JavaBinder(508): java.lang.IllegalArgumentException:
> > > provider=gps1
> > > ERROR/JavaBinder(508):     at
>
> > > android.server.LocationManagerService.getProviderInfo(LocationManagerService.java:
> > > 649)
> > > ERROR/JavaBinder(508):     at android.location.ILocationManager
> > > $Stub.onTransact(ILocationManager.java:127)
> > > ERROR/JavaBinder(508):     at
> > > android.os.Binder.execTransact(Binder.java:274)
> > > ERROR/JavaBinder(508):     at android.dalvik.NativeStart.run(Native
> > > Method)
> > > DEBUG/LocationProvider(13685): Constructor: name = gps1
> > > DEBUG/dalvikvm(13685): Exception Ljava/lang/RuntimeException; from
> > > ActivityThread.java:1758 not caught locally
> > > DEBUG/dalvikvm(13685): Exception Ljava/lang/RuntimeException; from
> > > ZygoteInit.java:1553 not caught locally
> > > DEBUG/AndroidRuntime(13685): Shutting down VM
> > > WARN/dalvikvm(13685): threadid=3: thread exiting with uncaught
> > > exception (group=0x4000fdf8)
> > > ERROR/AndroidRuntime(13685): Uncaught handler: thread Main exiting due
> > > to uncaught exception
> > > ERROR/AndroidRuntime(13685): java.lang.RuntimeException: Unable to
> > > start activity ComponentInfo{org.me.locationmanager1/
> > > org.me.locationmanager1.MyLocationManager}:
> > > java.lang.NullPointerException
> > > ERROR/AndroidRuntime(13685):     at
> > > android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> > > 1758)
> > > ERROR/AndroidRuntime(13685):     at
> > > android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
> > > 1770)
> > > ERROR/AndroidRuntime(13685):     at android.app.ActivityThread.access
> > > $1500(ActivityThread.java:99)
> > > ERROR/AndroidRuntime(13685):     at android.app.ActivityThread
> > > $H.handleMessage(ActivityThread.java:1271)
> > > ERROR/AndroidRuntime(13685):     at
> > > android.os.Handler.dispatchMessage(Handler.java:80)
> > > ERROR/AndroidRuntime(13685):     at android.os.Looper.loop(Looper.java:
> > > 91)
> > > ERROR/AndroidRuntime(13685):     at
> > > android.app.ActivityThread.main(ActivityThread.java:3052)
> > > ERROR/AndroidRuntime(13685):     at
> > > java.lang.reflect.Method.invokeNative(Native Method)
> > > ERROR/AndroidRuntime(13685):     at
> > > java.lang.reflect.Method.invoke(Method.java:356)
> > > ERROR/AndroidRuntime(13685):     at android.os.ZygoteInit
> > > $MethodAndArgsCaller.run(ZygoteInit.java:1547)
> > > ERROR/AndroidRuntime(13685):     at
> > > android.os.ZygoteInit.main(ZygoteInit.java:1445)
> > > ERROR/AndroidRuntime(13685):     at
> > > android.dalvik.NativeStart.main(Native Method)
> > > ERROR/AndroidRuntime(13685): Caused by: java.lang.NullPointerException
> > > ERROR/AndroidRuntime(13685):     at
> > > android.location.LocationManager.createProvider(LocationManager.java:
> > > 61)
> > > ERROR/AndroidRuntime(13685):     at
> > > android.location.LocationManager.getProvider(LocationManager.java:119)
> > > ERROR/AndroidRuntime(13685):     at
> > > org.me.locationmanager1.MyLocationManager.onCreate(MyLocationManager.java:
> > > 30)
> > > ERROR/AndroidRuntime(13685):     at
> > > android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
> > > 847)
> > > ERROR/AndroidRuntime(13685):     at
> > > android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
> > > 1728)
> > > ERROR/AndroidRuntime(13685):     ... 11 more
> > > INFO/Process(508): Sending signal. PID: 13685 SIG: 3
> > > INFO/dalvikvm(13685): threadid=7: reacting to signal 3
> > > INFO/dalvikvm(13685): DALVIK THREADS:
> > > INFO/dalvikvm(13685): "Main" prio=5 tid=3 NATIVE
> > > INFO/dalvikvm(13685):   | group="main" sCount=1 dsCount=0 s=0
> > > obj=0x40010450
> > > INFO/dalvikvm(13685):   | sysTid=496 nice=0 sched=0/0
> > > handle=-1092584196
> > > INFO/dalvikvm(13685):   at android.os.BinderProxy.transact(Native
> > > Method)
> > > INFO/dalvikvm(13685):   at
>
> > > android.app.ActivityManagerProxy.handleApplicationError(ActivityManagerNative.java:
> > > 1441)
> > > INFO/dalvikvm(13685):   at
> > > android.os.RuntimeInit.crash(RuntimeInit.java:250)
> > > INFO/dalvikvm(13685):   at android.os.RuntimeInit
> > > $UncaughtHandler.uncaughtException(RuntimeInit.java:56)
> > > INFO/dalvikvm(13685):   at
> > > java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:853)
> > > INFO/dalvikvm(13685):   at
> > > java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:850)
>
> > > showing illegal argument exception, means "gps1" is not recognizing as
> > > a location provider, please tell the error..
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to