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