Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9092385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:49:59+00:00 2026-06-16T22:49:59+00:00

I’.m developing this on Eclipse. My app aims at finding the current location using

  • 0

I’.m developing this on Eclipse.
My app aims at finding the current location using GPS, but when I run it on the emulator, it shows an unexpected force close. I have attached the main.xml, java file and manifest.xml.

Main file:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
tools:context=".GooglemapsActivity" >

   <com.google.android.maps.MapView
android:id="@+id/mapview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="0o6t2Gs5-C0eAHL2ZNbwvzu4pwsgX50HX2X8rKA"
 />

</RelativeLayout>

Java file:

package com.example.mapgp;   
import android.location.Location;
import android.location.LocationManager;
import android.location.LocationListener;
import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.view.Menu;
import com.example.mapgp.R;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import android.widget.Toast;

public class Gmapwithgps extends MapActivity {
public MapView mapView;
public MapController mc;
public MyLocationListener locl;
public LocationManager manager;

public class MyLocationListener implements LocationListener
{   
    public void onLocationChanged(Location loc)
    {
        loc.getLatitude();
        loc.getLongitude();
        String Text = "My current location is: " +
        "Lati = " + loc.getLatitude() +
        "Longi = " + loc.getLongitude();
        Toast.makeText( getApplicationContext(), Text, Toast.LENGTH_SHORT).show();

    }

    @Override
    public void onProviderDisabled(String provider)
    {
        Toast.makeText( getApplicationContext(),"Gps Disabled",Toast.LENGTH_SHORT ).show();
    }

    @Override
    public void onProviderEnabled(String provider)
    {
        Toast.makeText( getApplicationContext(),"Gps Enabled",Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onStatusChanged(String provider, int status, Bundle extras)
    {

    }

}   

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_gmapwithgps);

    mapView = (MapView) findViewById(R.id.mapview1);
    mapView.setBuiltInZoomControls(true);

    mc = mapView.getController();

    manager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
    locl = new MyLocationListener();
    manager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 35000, 10, this.locl);

}   

protected boolean isRouteDisplayed() {
     return false;
     }

public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.activity_gmapwithgps, menu);
    return true;
}

}

Manifest.xml file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.example.mapgp"
    android:versionCode="1"
    android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="10" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <uses-library android:name="com.google.android.maps"/>

    <activity
        android:name="com.example.mapgp.GmapwithgpsActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

Logcat:

01-04 22:36:54.120: D/AndroidRuntime(1510): Shutting down VM
01-04 22:36:54.120: W/dalvikvm(1510): threadid=1: thread exiting with uncaught          exception (group=0x40015560)
01-04 22:36:54.251: E/AndroidRuntime(1510): FATAL EXCEPTION: main
01-04 22:36:54.251: E/AndroidRuntime(1510): java.lang.RuntimeException: Unable to   instantiate activity    ComponentInfo{com.example.mapgp/com.example.mapgp.GmapwithgpsActivity}: java.lang.ClassNotFoundException: com.example.mapgp.GmapwithgpsActivity in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/com.example.mapgp-1.apk]
01-04 22:36:54.251: E/AndroidRuntime(1510):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
01-04 22:36:54.251: E/AndroidRuntime(1510):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
01-04 22:36:54.251: E/AndroidRuntime(1510):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
01-04 22:36:54.251: E/AndroidRuntime(1510):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
01-04 22:36:54.251: E/AndroidRuntime(1510):     at android.os.Handler.dispatchMessage(Handler.java:99)
01-04 22:36:54.251: E/AndroidRuntime(1510):     at android.os.Looper.loop(Looper.java:130)
01-04 22:36:54.251: E/AndroidRuntime(1510):     at android.app.ActivityThread.main(ActivityThread.java:3683)
01-04 22:36:54.251: E/AndroidRuntime(1510):     at java.lang.reflect.Method.invokeNative(Native Method)
01-04 22:36:54.251: E/AndroidRuntime(1510):     at java.lang.reflect.Method.invoke(Method.java:507)
01-04 22:36:54.251: E/AndroidRuntime(1510):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
01-04 22:36:54.251: E/AndroidRuntime(1510):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
01-04 22:36:54.251: E/AndroidRuntime(1510):     at dalvik.system.NativeStart.main(Native Method)
01-04 22:36:54.251: E/AndroidRuntime(1510): Caused by: java.lang.ClassNotFoundException: com.example.mapgp.GmapwithgpsActivity in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/com.example.mapgp-1.apk]
01-04 22:36:54.251: E/AndroidRuntime(1510):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
01-04 22:36:54.251: E/AndroidRuntime(1510):     at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
01-04 22:36:54.251: E/AndroidRuntime(1510):     at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
01-04 22:36:54.251: E/AndroidRuntime(1510):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
01-04 22:36:54.251: E/AndroidRuntime(1510):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
01-04 22:36:54.251: E/AndroidRuntime(1510):     ... 11 more
01-04 22:37:24.730: I/Process(1510): Sending signal. PID: 1510 SIG: 9
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T22:50:00+00:00Added an answer on June 16, 2026 at 10:50 pm

    You have a wrong class name activity in your Manifest.

    Change it to

     <activity
            android:name="Gmapwithgps"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
    
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
This could be a duplicate question, but I have no idea what search terms
I am using Paperclip to handle profile photo uploads in my app. They upload
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am writing an app for my school newspaper, which is run completely online
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I am using JSon response to parse title,date content and thumbnail images and place

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.