Hi, I am new to Android and am receiving the following log from the Eclipse console: "The manifest defines no activity!"
I am running Helios with the most updated SDK (release 10) and ADT plugin. My AVD is set for platform 2.2, API Level 8 (Galaxy Tab). I am attempting to run a GPS service from a main activity by modifying a piece of sample code from Android.com. Below is the manifest, the service and the activity. Any help in ferreting out the bug is much appreciated. %&%&%&%&%&%&%&%&%%&%%&%&%&%&%&%&%&%&%&%&%&%&&%&%%&%&%&%&%&%& MANIFEST &%&%&&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%& <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.logger" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="8" /> <!-- Permission to use GPS module --> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-feature android:name = "android.hardware.location"/> <uses-feature android:name = "android.hardware.location.network"/> <uses-feature android:name = "android.hardware.location.gps"/> <application android:icon="@drawable/icon" android:label="@string/ app_name"> <!-- Declaration of MainService --> <service android:name=".MainService"> <activity android:name=".DEOBR" android:label="@string/ app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </service> </application> </manifest> %&%&%%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%%& SERVICE %&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%& package com.logger; import java.util.Date; import java.util.Timer; import java.util.TimerTask; import android.app.Service; import android.content.Context; import android.content.Intent; import android.os.IBinder; import android.util.Log; import android.location.Criteria; import android.location.LocationManager; import android.location.Location; public class MainService extends Service{ private static final long UPDATE_TIME_INTERVAL = 0; private Timer timer = new Timer(); //%&%&%&%&&%%&%&%&%&%%&%%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%& //Static Data //%&%&%&%&%&%&%%%&%&%&%&&%%&%&%&%&&%&%&%%&%&%&%%%&%&%&%&%&%&%& public static DEOBR main_activity; //%&%&%&%&%&%&&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&% //Hooks into the main activity //%&%&%&%&%&%&%&%&&%%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%%&%&%&% public static void setDEOBR(DEOBR activity){ main_activity = activity; } //%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%& //Start the service //%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%& public void onCreate(){ super.onCreate(); startService(); } //%&%&%&%&%&%&%&%&%&%&%%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&% //service business logic //%&%%&&%%&%&%%&%&%&%&%&%&%&%&%&%&%%&%%%&%&%&%%%&%&%%&%&%&%&%& private void startService(){ TimerTask timerTask = new TimerTask(){ public void run() { getUpdateLocation(); } }; timer.scheduleAtFixedRate(timerTask,0,UPDATE_TIME_INTERVAL); Log.i(getClass().getSimpleName(), "Timer started!"); } public void stopService(){ if (timer != null) { timer.cancel(); } } @Override public IBinder onBind(Intent arg0){ return null; } /**%&%&%%%%&%&%&%&%&%%&%&%&%&%&%&%&%&%%&%&%%%%&%&%&%&%&%&%&%&%%&%&%&%& %&%&% %& %& %&%%%&%%%%%&%&%%&%&%&%&%&%& METHODS %&%&%&%&%&%%%&%&%&%&%&%&%%&%& %&%% %& %& %&%%&%%&%&%%%%&%&%&%&%&%&%&%&%&%%&%&%&%&%&%&%%&%&%&%&%&%&%&%&%&%&%&%&%& %&%*/ //Timer timer; Date currentDate; Location currentLocation; private void getUpdateLocation() { Log.i(getClass().getSimpleName(), "background task - start"); // get the system location service LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); // create criteria to filter the providers Criteria criteria = new Criteria(); String bestProvider = locationManager.getBestProvider(criteria, false); //Location location = locationManager.getLastKnownLocation(bestProvider); //Date date = new Date(); Location currentLocation = null; //Date currentDate; if(currentLocation == null){ currentLocation = locationManager.getLastKnownLocation(bestProvider); currentDate = new Date(); } } } %&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%& ACTIVITY %&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%& package com.logger; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.util.Log; //This is the main activity public class DEOBR extends Activity { //%&%&%&%&%&%&%&%&%&%&%&%%&%&%&%%&%&%&%&%&%&%&%&&%&%&%&%&%&%&% // Logic for the main activity //%&%&%%&%&%&%&%&%%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%&%& /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // setup and start MainService try { MainService.setDEOBR(this); Intent svc = new Intent(this, MainService.class); startService(svc); } catch (Exception e) { Log.e(">>>", "Problem creating the UI", e); } } @Override protected void onDestroy() { super.onDestroy(); // stop MainService Intent svc = new Intent(this, MainService.class); stopService(svc); } } -- 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] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

