GPS emulation

by olivier » Wed, 29 Apr 2009 01:07:49 GMT


Sponsored Links
 Hi all,

I am currently trying to simulate GPS fixs with android emulator, but
I encountered some problems. I can run the app, clic on the send
button in the emulator control, but, only the first click provides a
position. I am running an ubuntu jaunty, eclipse and SDK 1.5, on a
french system with the locale EN_US
Here is my code :

private class MyLocationListener implements LocationListener
            {
                @Override
                public void onLocationChanged(Location loc) {
                    if (loc != null) {
                        String s = "";
                        s += loc.getLatitude();
                        s += "   ";
                        s += loc.getLongitude();
                        Toast.makeText(getBaseContext(),
                            "Location changed : Lat: " + loc.getLatitude() +
                            " Lng: " + loc.getLongitude(),
                            Toast.LENGTH_SHORT).show();
                        Log.i("GPS", s);
                    }
                    else {
                        Log.i("Gps","loc_null");
                    }
                }

                @Override
                public void onProviderDisabled(String provider) {
                    // TODO Auto-generated method stub
                        Log.i("Gps","onProviderDisabled");
                }

                @Override
                public void onProviderEnabled(String provider) {
                    // TODO Auto-generated method stub
                        Log.i("Gps","onProviderEnabled");
                }

                @Override
                public void onStatusChanged(String provider, int status,
                    Bundle extras) {
                    // TODO Auto-generated method stub
                        Log.i("Gps","onStatusChanged : " + provider);
                }
            }

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
       //---use the LocationManager class to obtain GPS locations---
        lm = (LocationManager) getSystemService
(Context.LOCATION_SERVICE);

        locationListener = new MyLocationListener();

        lm.requestLocationUpdates(
            LocationManager.GPS_PROVIDER,
            0,
            0,
            locationListener);

    }

Can you tell me what I am doing wrong ?

Regards,

Olivier

--~--~---------~--~----~------------~-------~--~----~



GPS emulation

by ellipsoidmob...@googlemail.com » Wed, 29 Apr 2009 17:16:30 GMT


 Are you changing the location set in the emulator before each click,
or are you just sending the same location repeatedly?

I suspect (but don't know for sure) that even with distance & time set
to 0 in requestLocationUpdates, an update won't be generated if the
new location is identical to the old location.
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


GPS emulation

by Andreas Frey » Wed, 29 Apr 2009 17:28:38 GMT


 Hi,

i had a similar problem using the geo fix command - only the first
transmission of a newlocation worked.
Look @ here:



GPS emulation

by Olivier Tournaire » Wed, 29 Apr 2009 18:03:15 GMT


 i,

Hi,


I saw this post, same day as mine ;-)

I "solved" the problem with a dirty hack:


@Override
public void onLocationChanged(Location loc) {
if (loc != null) {
String s = "";
s += loc.getLatitude();
s += " ";
s += loc.getLongitude();
Log.i("GPS", s);
}
else {
Log.i("Gps","loc_null");
}
* lm.removeUpdates(locationListener);
lm.requestLocationUpdates(
LocationManager.GPS_PROVIDER,
xxx,
xxx
locationListener); *
}

Crappy isn't it ?

Regards,

Olivier



--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. view.draw() at horizontal offset?

Hi,
I have a very large view that is normally only very partially
displayed on the screen.  Is there any way for me to draw at an offset
into a bitmap from a canvas.  I am getting out of memory errors if I
try to access something at say pixel width 2000.

Code:

Bitmap image = Bitmap.createBitmap(4000, 300,
Bitmap.Config.ARGB_4444);
Canvas cv=new Canvas(image);
view1.draw(cv)

Thanks,
Bob
--~--~---------~--~----~------------~-------~--~----~

2. Very basic questions about porting and my linux based phone.

Hello!

I've been looking around for some info about android for any phone,
other the T-mobile and HTC developer platform.

I have a linux based phone, the yuhua Inid, sold in spain as Funker
f901 and in Thailand (where I got it) as i-mobile 904.

IT has an Intel PXA270 processor at 400mhz, 64mb RAM and 128mb Flash
NAND ram, touchscreen, 2mpx autofocus camera with light. It seems to
cope ok with minimum requirements for android phone. The process to
get its nand flash rewritten is suspiciously similar to that of HTC
android enabled phones:

First of all, I have to install an USB driver with the following
label: "Intel PXA27X USB Serial Driver Installation Disk"

On the phone, then I got to press and hold a buttonl, plug it in the
usb port, and it is recognized as a serial port. I have an utility,
downloaded from the phone-brand website, installed on the PC  that
allows me to load different libraries and files, and from there  they
get uploaded into the NAND on the phone...

Actually, the utility reads either a large .bin file (which as I coud
see, is comprised of the different libraries and files, all packed
inside) or each file separately.  The files are open, no key /
encription or whatever is used.

Mi linux and phone development knowledge is close to null. So please
excuse me if I am just writing obvious things.

The individual files that this "phone upgrading thingy" loads and
burns into the phone need to be loaded under the following titles:
Kernel, root FS, Program FS, User Data FS,  User Local, Tat, Grps2121,
patch, SysParm_Ind, SysParm_Dep. OR else I just select a huge BIN file
wich seems to have inside 7 files packed in it, that get stuffed (it
takes 30 minutes) into the phone.

Can anyone tell me if they recognize any useful information from
this ? Is there a way I can install android on this phone ? What kind
of info is needed (I can search!) ... anyone is willing to help
me ? :) I would really love to see this phone get revamped with
ANDROID, and actually I know that the yuhua design house, is actually
about to sell a "from the beginning, android phone" which is
suspiciously the same as this one. I can only add that I am willing to
test anything you throw at me on the phone.

Regards,
Enrique.

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. Loading large assets

4. Using setCurrentTab on a TabHost in landscape mode doesn't work. (in emulator)

5. Controling a Video in a view

6. curious

7. Kuatkah Android Samsung Tantang HTC?