Liam,

Casting from List to ArrayList works fine. It does not cause an error.

I guess I run into a problem because my target is Android 1.1, not 1.5

You can get cell and location related information in a number of
ways:using other applications as starting point. For example:

- radioinfo.java
[platform/packages/apps/Settings.git] / src / com / android /
settings / RadioInfo.java

- cellfinder
http://code.google.com/p/codetastrophe/

- AndroidGpsLocationProvider.java
http://code.google.com/p/gears/source/browse/trunk/gears/geolocation/AndroidGpsLocationProvider.java


With regard to duplicating the fieldtest application functionality,
you need working getNeighboringCellInfo() and other neighboring cell
related function.

Note that if you do a dexdump of fieldtest, you will see that it uses
OEM RIL related functions to extract neighboring cell related
information (however, I could be wrong about this).

I hope this helps. Unfortunately, I am still stuck with regards to
getNeighboringCellInfo().

Alex Donnini

On Jun 16, 10:47 am, Ne0 <liamjamesalf...@googlemail.com> wrote:
> Yes it does, though you have make sure that you are building your app
> for 1.5 versions only, this is done when setting up your project using
> Eclipse, thats how i do it anyway.
>
> I have yet to test my code on an actual phone, though there is one
> thing you may be clear up for me, its been many years since i have
> used java, you are using ArrayList<>, though the documentation
> describes getNeighboringCellInfo() as returning a List<>, are these
> the same thing? If not it may be an error in your code, mine works on
> the emulator using List<> though it returns NULL.
>
> Hope this helps.
>
> On a different note, i am trying to get other info for my app, do you
> know how to get anything other LAC, CID, Neighbour list with power?
> Like the Field test App? Cheers
>
> Liam
>
> On Jun 16, 3:35 pm, alexdonnini <alexdonn...@ieee.org> wrote:
>
> > Hello,
>
> > I have a simple/quick question.
>
> > Does TelephonyManager in Android 1.5 SDK, Release 2 (the SDK version I
> > am using) contain the
>
> > getNeighboringCellInfo()
>
> > method?
>
> > The reference documentation,
>
> >http://developer.android.com/reference/android/telephony/TelephonyMan...()
>
> > seems to indicate that it does.
>
> > However, if you try to use getNeighboringCellInfo() in an application,
> > it does not work generating "cannot be resolved to a type" error.
>
> > If you add the Java libraries framework intermediaries library from
> > Android the "cannot be resolved to a type" error is resolved but the
> > application crashes at run-time (VerifyError, not surprisingly).
>
> > My hope is that I am overlooking something obvious, and/or making a
> > simple mistake.
>
> > If my mistake is in the code below, I would appreciate seeing a
> > snipped that does work.
>
> >  Thanks.
>
> > Alex Donnini
>
> > P.S. here is the code of the application I wrote to test
> > getNeighboringCellInfo()
>
> > package com.telephonytest.com;
>
> > import java.util.ArrayList;
>
> > import android.app.Activity;
> > import android.os.Bundle;
> > import android.telephony.NeighboringCellInfo;
> > import android.telephony.TelephonyManager;
> > import android.util.Log;
>
> > public class TelephonyTest extends Activity {
>
> >         private static String TAG = "TelephonyTest";
> >         private static TelephonyManager mTelephonyManager;
>
> >     /** Called when the activity is first created. */
> >     @Override
> >     public void onCreate(Bundle savedInstanceState) {
> >         super.onCreate(savedInstanceState);
> >         setContentView(R.layout.main);
>
> >         mTelephonyManager = (TelephonyManager)getSystemService
> > (TelephonyTest.TELEPHONY_SERVICE);
>
> >         ArrayList<NeighboringCellInfo> mNeighboringCellInfo;
> >         mNeighboringCellInfo = new ArrayList<NeighboringCellInfo>();
> >         mNeighboringCellInfo = (ArrayList)
> > mTelephonyManager.getNeighboringCellInfo();
> >         for(int i = 0; i < mNeighboringCellInfo.size(); ++i)
> >         {
> >                 Log.i(TAG,"mNeighboringCellInfo.get(i) -
> > "+mNeighboringCellInfo.get(i).toString());
> >         }
>
> >     }
>
> > }
>
> > ....
> > <uses-permission
> > android:name="android.permission.ACCESS_COARSE_LOCATION" />
> > <uses-permission
> > android:name="android.permission.ACCESS_FINE_LOCATION" />
> > <uses-permission
> > android:name="android.permission.ACCESS_COARSE_UPDATES" />
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to