Встраивание файла CWAC-LocationPoller.jar в проект

Intro: 

   I am developing LBS application, I want to embed CWAC-LocationPoller.jar File to my project , I have added the jar file in libs and build path , and following is my Mainfest.xml , I have provided GPS provider When i run the App Gps is not locating and I cant see the records in my files .. Please help me

I have edited the receiver name, I dont knw how to include this jar file m This is the first time i am doing, I have provided all the permission .

Я включил свой файл MainAcitivty, у меня есть EXTRA_PROVIDER есть GPSProvider, и я установил интервал времени на 1 мин. Я могу видеть записи в файле с сетью, у провайдера нет моего GPS, и я не знаю, почему GPS не находится. Но у меня есть на моем 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();
      }

}

0 ответов

Другие вопросы по тегам