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

  • Home
  • SEARCH
  • 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 8006193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:25:45+00:00 2026-06-04T17:25:45+00:00

I’m hoping someone can help me with an issue I’m having with sending emulated

  • 0

I’m hoping someone can help me with an issue I’m having with sending emulated GPS data to an Android AVD in Eclipse. If I run the application on a real device everything works fine, but when I attempt to uses the built in emulator in eclipse nothing will happen. I have also tried telneting into the AVD and issuing the geo fix command. Below is the code I am using although I don’t think there is anything wrong with it if it works on the real device

The manifest file

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.TestGoogleMaps"
android:versionCode="1"
android:versionName="1.0" >
    <uses-sdk android:targetSdkVersion="10" android:minSdkVersion="8"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>  
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>  
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".TestingGoogleMapsActivity"
        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>
</manifest>

Main.xml

<?xml version="1.0" encoding="utf-8"?>
  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="vertical"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
  >
</LinearLayout>

The Main Code

package net.TestGoogleMaps;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

public class TestingGoogleMapsActivity extends Activity 
{

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) 
        {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        LocationManager locationManager; 
        String context = Context.LOCATION_SERVICE; 
        locationManager = (LocationManager)getSystemService(context); 
        Criteria criteria = new Criteria(); 
        criteria.setAccuracy(Criteria.ACCURACY_FINE); 
        criteria.setAltitudeRequired(false); 
        criteria.setBearingRequired(false); 
        criteria.setCostAllowed(true); 
        criteria.setPowerRequirement(Criteria.POWER_LOW); 
        String provider = locationManager.getBestProvider(criteria, true); 

        Location location = locationManager.getLastKnownLocation(provider); 


        updateWithNewLocation(location);


        locationManager.requestLocationUpdates(provider, 2000, 10,    
                                               locationListener); 
    }



    private final LocationListener locationListener = new LocationListener() { 
        public void onLocationChanged(Location location) { 
          updateWithNewLocation(location); 
        } 

        public void onProviderDisabled(String provider){ 
          updateWithNewLocation(null); 
        } 

        public void onProviderEnabled(String provider){ } 
        public void onStatusChanged(String provider, int status,  
                                    Bundle extras){ } 
      };




    public void updateWithNewLocation(Location location)
    {

        Context contextApp = getApplicationContext();

        String text ;
        int duration = 2000;

        if(location == null)
        {
            text ="Null Location";

        }
        else
        {
            text = "Lat : " + location.getLatitude() + " Lon: " + location.getLongitude();
        }

        Toast toast = Toast.makeText(contextApp, text, duration);
        toast.show();
    }   
}

I will also get the following error sometimes when simulating the GPS data from eclipse to the device in the LogCat tab of eclipse.

05-31 02:31:35.158: E/InputQueue-JNI(347): channel '406e6640  net.TestGoogleMaps/net.TestGoogleMaps.TestingGoogleMapsActivity (client)' ~ Publisher closed input channel or an error occurred.  events=0x8

Any help would be greatly appreciated!

  • 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-04T17:25:46+00:00Added an answer on June 4, 2026 at 5:25 pm

    I known your problem, You can set your current (long/lag) manually at

    DDMS->Devices->Emulator Control->Location Controls->Manual->input (Long/Lag) and SEND

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an issue I'm hoping someone can help with. I have an application
I've ran into an issue I'm hoping someone can help me solve. I've run
My development team has run into a design issue. I'm hoping someone can help
I have an issue that is driving me nuts and hoping someone can help.
I have a very strange issue that I'm hoping someone can help me with.
Hi There I am hoping that someone can help me with this php issue.
I'm hoping that someone can help me with this issue. I've been racking my
I'm having trouble with one particular issue, I was hoping someone could help me
I'm hoping someone can help me a WAL-shipping and warm standby issue. My standby
I have a small issue which I'm hoping someone can help me resolve. Copied

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.