android - Embedding CWAC-LocationPoller.jar File into the Projec -
intro: developing lbs application, want embed cwac-locationpoller.jar file project , have added jar file in libs , build path , , next mainfest.xml , have provided gps provider when run app gps not locating , cant see records in files .. please help me have edited receiver name, dont knw how include jar file m first time doing, have provided permission .
i have included mainacitivty file ,i have given extra_provider has gpsprovider , have set time interval 1min. can see records in file network has provider not gps , , dont know why gps not locating . have on gps
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.trackmejar" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="17" /> <uses-permission android:name="android.permission.wake_lock" /> <uses-permission android:name="android.permission.access_fine_location" /> <uses-permission android:name="android.permission.write_external_storage" /> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name="com.example.trackmejar.mainactivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> <receiver android:name=".locationreceiver" /> <receiver android:name="com.example.trackmejar.locationpoller" /> <service android:name="com.example.trackmejar.locationpollerservice" /> </application> </manifest> mainactivity @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mgr=(alarmmanager)getsystemservice(alarm_service); intent i=new intent(this, locationpoller.class); i.putextra(locationpoller.extra_intent, new intent(this, locationreceiver.class)); i.putextra(locationpoller.extra_provider, locationmanager.gps_provider); pi=pendingintent.getbroadcast(this, 0, i, 0); mgr.setrepeating(alarmmanager.elapsed_realtime_wakeup, systemclock.elapsedrealtime(), period, pi); toast .maketext(this, "location polling every 30 minutes begun", toast.length_long) .show(); } public void omgpleasestop(view v) { mgr.cancel(pi); finish(); } }
android commonsware-cwac
No comments:
Post a Comment