andbook!.pdf - Learning Android Get an anddev.org - Android-Shirt Back to index
anddev.org Header Logo
FAQ Search Top rated articles Browse Feeds anddev.org - Authors Contact Details Register Log in

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

Goto page Previous  1, 2, 3  Next
 
       anddev.org - Android Development Community | Android Tutorials | Index -> Map Applications
Author Message
plusminus
Site Admin


Joined: 14 Nov 2007
Posts: 1878
Location: Germany

PostPosted: Tue Feb 05, 2008 10:44 am    Post subject: Reply with quote

Hello chris,

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

Regards,
plusminus

_________________

| Android Development Community / Tutorials
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nisha
Experienced Developer


Joined: 15 Feb 2008
Posts: 50

PostPosted: Wed Feb 20, 2008 8:43 am    Post subject: retrieve data from textbox Reply with quote

hi plusminus,

Thanks Very Happy ... 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
Back to top
View user's profile Send private message
plusminus
Site Admin


Joined: 14 Nov 2007
Posts: 1878
Location: Germany

PostPosted: Wed Feb 20, 2008 10:16 am    Post subject: Reply with quote

Hello nisha,

We just wrapped a parseInt around the getting of the String-Content:
Java:
int lac = Integer.parseInt(myEditLac.getText().toString());

To get the string without conversion:
Java:
String s = myEditLac.getText().toString();


Regards,
plusminus

_________________

| Android Development Community / Tutorials
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nisha
Experienced Developer


Joined: 15 Feb 2008
Posts: 50

PostPosted: Thu Feb 21, 2008 10:35 am    Post subject: how to retrieve contents from list Reply with quote

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

Regards,
nisha
Back to top
View user's profile Send private message
gvkreddyvamsi
Developer


Joined: 21 Jan 2008
Posts: 43
Location: INDIA

PostPosted: Thu Feb 21, 2008 11:04 am    Post subject: how i can replace ContentURI with new class Uri Reply with quote

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
Java:
/* Create a geo-ContentURI containing the
                     * lat/long-values and start the Map-Application */

                    [b]ContentURI[/b] geoURI = [b]ContentURI[/b].create("geo:" + lat + "," + lng);
                    Intent mapViewIntent = new Intent(
                              android.content.Intent.VIEW_ACTION, geoURI);
                    startActivity(mapViewIntent);


Notification manager syntax also changed...

Java:
[b]NotificationManager[/b] nm = (NotificationManager)
                                   getSystemService(NOTIFICATION_SERVICE);
                    nm.notifyWithText(100, "Could not find lat/long information",
                              NotificationManager.LENGTH_SHORT, null);


how i can resolve these two....

thanks in advance

by
vamsi
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Jesmiatka
Senior Developer


Joined: 04 Feb 2008
Posts: 118
Location: Netherlands

PostPosted: Thu Feb 21, 2008 11:39 am    Post subject: Reply with quote

Hi,

I suggest you read the following site:
http://code.google.com/android/migrating/m3-to-m5/m5-api-changes.html

If you read this you will see:
Quote:

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.

Quote:

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).
Back to top
View user's profile Send private message
plusminus
Site Admin


Joined: 14 Nov 2007
Posts: 1878
Location: Germany

PostPosted: Thu Feb 21, 2008 1:35 pm    Post subject: Reply with quote

Hello vamsi,

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

ContentURI is now just called URI. Here it would probably be like:
Java:
Uri geoURI = Uri.parse("geo:" + lat + "," + lng);


Regards,
plusminus

_________________

| Android Development Community / Tutorials
Back to top
View user's profile Send private message Send e-mail Visit poster's website
plusminus
Site Admin


Joined: 14 Nov 2007
Posts: 1878
Location: Germany

PostPosted: Thu Feb 21, 2008 4:25 pm    Post subject: Re: how to retrieve contents from list Reply with quote

Hello nisha,

From a ListActivity:
Java:
this.getListAdapter().getItem(position);

or from a ListView:
Java:
myListView.getAdapter().getItem(position);


Regards,
plusminus

_________________

| Android Development Community / Tutorials
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nisha
Experienced Developer


Joined: 15 Feb 2008
Posts: 50

PostPosted: Fri Feb 22, 2008 11:19 am    Post subject: retrieve data from list Reply with quote

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??? .... Confused


Java:
rows = dbHelper.fetchAllRows();
                       for (Row row : rows) {
                           items.add(row.name);
                           items.add(row.location);
}


Regards and Thanks,
nisha
Back to top
View user's profile Send private message
nisha
Experienced Developer


Joined: 15 Feb 2008
Posts: 50

PostPosted: Mon Feb 25, 2008 10:45 am    Post subject: How to create two views for an activity Reply with quote

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
Back to top
View user's profile Send private message
plusminus
Site Admin


Joined: 14 Nov 2007
Posts: 1878
Location: Germany

PostPosted: Mon Feb 25, 2008 1:56 pm    Post subject: Re: How to create two views for an activity Reply with quote

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??? .... Confused


Just a ListView Question 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

_________________

| Android Development Community / Tutorials
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nisha
Experienced Developer


Joined: 15 Feb 2008
Posts: 50

PostPosted: Tue Feb 26, 2008 11:21 am    Post subject: addcontentview is working Reply with quote

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..

Java:
setContentView(R.layout.save);
addContentView(tv, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT));

Regards,
Nisha
Back to top
View user's profile Send private message
plusminus
Site Admin


Joined: 14 Nov 2007
Posts: 1878
Location: Germany

PostPosted: Tue Feb 26, 2008 7:23 pm    Post subject: Reply with quote

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

Regards,
plusminus

_________________

| Android Development Community / Tutorials
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rahul_mawkins
Developer


Joined: 27 Feb 2008
Posts: 33

PostPosted: Wed Feb 27, 2008 3:19 pm    Post subject: How to get CellId and LAC Reply with quote

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
Back to top
View user's profile Send private message Yahoo Messenger
rock_win
Junior Developer


Joined: 21 Jan 2008
Posts: 10

PostPosted: Sun Mar 23, 2008 8:42 am    Post subject: Reply with quote

Hi

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

Code:
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();
     }
Back to top
View user's profile Send private message
Display posts from previous:   
       anddev.org - Android Development Community | Android Tutorials | Index -> Map Applications All times are GMT + 1 Hour
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


© 2007, Android Development Community
All rights reserved.
Powered by phpBB.