Poor mans GPS - Cell(Tower)ID / Location Area Code -Lookup

Tutorials that use the MapActivity. Many using GPS functionality.

Postby plusminus » Tue Feb 05, 2008 10:44 am

Hello chris,

would nice to know if one could get something useful out of this.
It's worth a try, somewhen :(

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

retrieve data from textbox

Postby nisha » Wed Feb 20, 2008 8:43 am

hi plusminus,

Thanks :D ... I am trying to retrieve data from textbox but not able to get it.. in cellidlatlong example we can retrieve integer values but i want to retrieve string value say for example username and password.So that authentication can be done.

Regards,
nisha
nisha
Experienced Developer
Experienced Developer
 
Posts: 80
Joined: Fri Feb 15, 2008 7:52 am

Postby plusminus » Wed Feb 20, 2008 10:16 am

Hello nisha,

We just wrapped a parseInt around the getting of the String-Content:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. int lac = Integer.parseInt(myEditLac.getText().toString());
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

To get the string without conversion:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. String s = myEditLac.getText().toString();
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

how to retrieve contents from list

Postby nisha » Thu Feb 21, 2008 10:35 am

Hi,
how can i retrieve contents from the list...

Regards,
nisha
nisha
Experienced Developer
Experienced Developer
 
Posts: 80
Joined: Fri Feb 15, 2008 7:52 am

how i can replace ContentURI with new class Uri

Postby gvkreddyvamsi » Thu Feb 21, 2008 11:04 am

Hi,

I was tried to implement GPS on new SDK. But in new SDK no package named ContentUri how i can modify the code at ContentURI ....

Code given below
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. /* Create a geo-ContentURI containing the
  2.                      * lat/long-values and start the Map-Application */
  3.                     <span style="font-weight: bold">ContentURI</span> geoURI = <span style="font-weight: bold">ContentURI</span>.create("geo:" + lat + "," + lng);
  4.                     Intent mapViewIntent = new Intent(
  5.                               android.content.Intent.VIEW_ACTION, geoURI);
  6.                     startActivity(mapViewIntent);
Parsed in 0.035 seconds, using GeSHi 1.0.8.4


Notification manager syntax also changed...

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. <span style="font-weight: bold">NotificationManager</span> nm = (NotificationManager)
  2.                                    getSystemService(NOTIFICATION_SERVICE);
  3.                     nm.notifyWithText(100, "Could not find lat/long information",
  4.                               NotificationManager.LENGTH_SHORT, null);
  5.  
Parsed in 0.036 seconds, using GeSHi 1.0.8.4


how i can resolve these two....

thanks in advance

by
vamsi
gvkreddyvamsi
Developer
Developer
 
Posts: 43
Joined: Mon Jan 21, 2008 5:10 am
Location: INDIA

Postby Jesmiatka » Thu Feb 21, 2008 11:39 am

Hi,

I suggest you read the following site:
http://code.google.com/android/migratin ... anges.html

If you read this you will see:
The android.net.ContentURI class has be replaced with the new android.net.Uri class. This is not a 1:1 replacement and engenders a number of necessary


Also NotificationManager had a revamp.

The notification manager now only does persistent notifications, and they are just called notifications. android.app.NotificationManager now has two methods: notify(id, notification) and cancel(id).
Jesmiatka
Senior Developer
Senior Developer
 
Posts: 164
Joined: Mon Feb 04, 2008 3:37 pm
Location: Netherlands

Top

Postby plusminus » Thu Feb 21, 2008 1:35 pm

Hello vamsi,

what was a Notification before m5 is now a so called Toast: :arrow: :src: http://www.anddev.org/viewtopic.php?t=916

ContentURI is now just called URI. Here it would probably be like:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. Uri geoURI = Uri.parse("geo:" + lat + "," + lng);
Parsed in 0.036 seconds, using GeSHi 1.0.8.4


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Re: how to retrieve contents from list

Postby plusminus » Thu Feb 21, 2008 4:25 pm

Hello nisha,

From a ListActivity:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. this.getListAdapter().getItem(position);
Parsed in 0.036 seconds, using GeSHi 1.0.8.4

or from a ListView:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. myListView.getAdapter().getItem(position);
Parsed in 0.036 seconds, using GeSHi 1.0.8.4


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

retrieve data from list

Postby nisha » Fri Feb 22, 2008 11:19 am

Hi plusminus,
Thanks... I am trying to retrieve data from list.. i am using dbhelper class...
Now the data is in items... how to get it on emulater??? .... :?


Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. rows = dbHelper.fetchAllRows();
  2.  
  3.                         for (Row row : rows) {
  4.  
  5.                             items.add(row.name);
  6.  
  7.                             items.add(row.location);
  8.  
  9. }
Parsed in 0.037 seconds, using GeSHi 1.0.8.4


Regards and Thanks,
nisha
nisha
Experienced Developer
Experienced Developer
 
Posts: 80
Joined: Fri Feb 15, 2008 7:52 am

How to create two views for an activity

Postby nisha » Mon Feb 25, 2008 10:45 am

Hi,
I want two views in a activity(one as a back ground and the other
as a foreground).I used addContentView to add the second view after
doing setContentView to add the first view.It's not working.Can anyone
let me know how do I go about this.
Regards,
Nisha
nisha
Experienced Developer
Experienced Developer
 
Posts: 80
Joined: Fri Feb 15, 2008 7:52 am

Re: How to create two views for an activity

Postby plusminus » Mon Feb 25, 2008 1:56 pm

Hello nisha,

nisha wrote: Thanks... I am trying to retrieve data from list.. i am using dbhelper class...
Now the data is in items... how to get it on emulater??? .... :?


Just a ListView :?: You can create an ArrayAdapter with any Array filled with Objects that support a toString()-methods.

Or you create an Adapter on your own. Search for IconifiedList-Tutorial.

nisha wrote:Hi,
I want two views in a activity(one as a back ground and the other
as a foreground).I used addContentView to add the second view after
doing setContentView to add the first view.It's not working.Can anyone
let me know how do I go about this.
Regards,
Nisha


What do you mean with "it's not working". Maybe post some code.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

addcontentview is working

Postby nisha » Tue Feb 26, 2008 11:21 am

Hi,

I was trying this way... and got it... is there any other way to do the same? I saw 3 types of addcontentviews and this is what i got..

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. setContentView(R.layout.save);
  2.  
  3. addContentView(tv, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT));
  4.  
  5.  
Parsed in 0.037 seconds, using GeSHi 1.0.8.4

Regards,
Nisha
nisha
Experienced Developer
Experienced Developer
 
Posts: 80
Joined: Fri Feb 15, 2008 7:52 am

Postby plusminus » Tue Feb 26, 2008 7:23 pm

You could also have started with the second View already defined in XML, but with Visibility set to GONE.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

How to get CellId and LAC

Postby rahul_mawkins » Wed Feb 27, 2008 3:19 pm

My question is how to get Cell-ID and LAC
I live in New Jersey

Does this Cell-ID belongs to emmulator
and whats the LAC

Very nice tutorial though
rahul_mawkins
Developer
Developer
 
Posts: 34
Joined: Wed Feb 27, 2008 4:09 am

Postby rock_win » Sun Mar 23, 2008 8:42 am

Hi

can someone please explain the different values written in writeRequest Method:

Code: Select all
public void writeRequest(OutputStream outputStream) throws IOException {
          DataOutputStream os = new DataOutputStream(outputStream);
          os.writeShort(21);
          os.writeLong(0);
          os.writeUTF("fr");//country code
          os.writeUTF("Sony_Ericsson-K750");//phone make
          os.writeUTF("1.3.1");//software version
          os.writeUTF("Web");//type
          os.writeByte(27);

          os.writeInt(0); os.writeInt(0); os.writeInt(3);
          os.writeUTF("");
          os.writeInt(myCellID); // CELL-ID
          os.writeInt(myLAC); // LAC
          os.writeInt(0); os.writeInt(0);
          os.writeInt(0); os.writeInt(0);
          os.flush();
     }
rock_win
Junior Developer
Junior Developer
 
Posts: 11
Joined: Mon Jan 21, 2008 4:24 pm

Top
PreviousNext

Return to Map Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest