Is possible to include the RIL shared library (libril.so) from system/
lib?
And then call the functions directly from code? Such this function:
static void issueLocalRequest(int request, void *data, int len) (from
RIL.cpp)
Regards
> ...
>
> read more »
I'm not 100% clear on what you are trying to do, though if you are
trying to call RIL functions you should look at RIL.java. There is a
Sender and Receiver socket that is the interface between the kernal
and Android (thats my understanding anyway!). The only functions that
can be called in RIL.cpp, are called using this inteface. However it
will not give you any more network info then that available from the
SDK telephony manager, if you want more network info you have to be
able to invoke the OEM raw ril requests as described above, then you
have to decode the response.
These requests and responses will be dependent on the phone, there is
no open source standard for the low level network info yet. As for htc
(Dream anyway), libhtc_ril.so is their radio interface. If you have
any joy decoding OEM responses please post it here.
Ne0
> ...
>
> read more »
How I use the RIL.java? because is not included in the SDK.
Other thing, I cant communicate with the rild, because the sockets
only accepts one connection and only from the RIL.java. I tried the
rild-debug but when I turn off the radio interface through there, cant
turn on again (the telephony services stops).
It´s possible to replace the libril.so for a libril.so modified and
compiled by me?
On Dec 22 2009, 10:44 am, Master_Ne0
<master.ne0s.soluti...@googlemail.com> wrote:
> Ricardo,
>
> I'm not 100% clear on what you are trying to do, though if you are
> trying to callRILfunctions you should look atRIL.java. There is a
> Sender and Receiver socket that is the interface between the kernal
> and Android (thats my understanding anyway!). The only functions that
> can be called inRIL.cpp, are called using this inteface. However it
> will not give you any more network info then that available from the
> SDK telephony manager, if you want more network info you have to be
> able to invoke the OEM rawrilrequests as described above, then you
> have to decode the response.
>
> These requests and responses will be dependent on the phone, there is
> no open source standard for the low level network info yet. As for htc
> (Dream anyway), libhtc_ril.so is their radio interface. If you have
> any joy decoding OEM responses please post it here.
>
> Ne0
>
> On Dec 21, 7:08 pm, Ricardo Silva <ban...@gmail.com> wrote:
>
> > Hi again,
>
> > Is possible to include theRILshared library (libril.so) from system/
> ...
>
> read more »
Its not open source. Its a htc application.
On 5 Feb 2010 15:45, "mobot" <mark...@gmail.com> wrote:
Has anyone located the Field Test in the source? Please let me know.
--
On Jan 11, 4:56 am, Ricardo Silva <ban...@gmail.com> wrote:
> I want to, for example, turn off the ...
You received this message because you are subscribed to the Google Groups "android-platform" group.
...
Oh. Thanks. Any luck getting at this info in other ways?
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
--You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
It seems so. I'm looking for neighbor cells, rssi, ip address, etc.. Basically looking to present the current cellular landscape in an app. The same data HTC's field test app uses would be great.
Check these programs:
##data# (##3282#)
##debug#(##33284#)
So there is a way to get to the data, I just haven't figured it out yet.
After a long interval, back to Android RIL.
I've managed to fetch and parse a GSM Page request from the ril.
Using invokeOemRilRequestRaw method in
com.android.internal.telephony.Phone.
The approach was:
1. retrieve sample raw responses from logcat -b radio
This was done by a small change the method retToString in RIL.java:
} else if (ret instanceof byte[]) {
byte[] bytes = (byte[]) ret;
s = IccUtils.bytesToHexString(bytes);
This way the invokeOemRilRequestRaw raw bytes response is written to
the log (converted to an hex string).
2. After reading the log, parse the GSM Page response:
D/RILJ ( 141): [0168]> OEM_HOOK_RAW[0200000000000000]
D/RILJ ( 141): [0168]< OEM_HOOK_RAW
000000003030303200000000000000000000000000000000326400000000000000000000000000000000000032363830310000000000000000000000000000001100000030202d393900000000000000000000000000000030202d393900000000000000000000000000000030202d393900000000000000000000000000000030202d393900000000000000000000000000000030202d393900000000000000000000000000000030202d3939000000000000000000000000000000110000000000000032363830310000000000000000000000000000003538643763626235000000000000000000000000fa050000ff000000ff0000003000000000000000000000000000000000000000ff000000
So the first line is the GSM Page request, the second is the byte
response (both byte arrays converted to hex strings).
So, now we can parse this into meaningful information using:
ByteBuffer bb = ByteBuffer.wrap(bytes);
bb.order(ByteOrder.LITTLE_ENDIAN);
System.out.println("ARFCN: " + bb.getInt());
System.out.println("LAC: " + getStringFromBytes(bb, 20));
System.out.println("RAC: " + getStringFromBytes(bb, 20));
System.out.println("MNC/MCC:" + getStringFromBytes(bb, 20));
System.out.println("RSSI:" + bb.getInt());
System.out.println("Ncell Info1:" + getStringFromBytes(bb, 20));
System.out.println("Ncell Info2:" + getStringFromBytes(bb, 20));
System.out.println("Ncell Info3:" + getStringFromBytes(bb, 20));
System.out.println("Ncell Info4:" + getStringFromBytes(bb, 20));
System.out.println("Ncell Info4:" + getStringFromBytes(bb, 20));
System.out.println("Ncell Info6:" + getStringFromBytes(bb, 20));
System.out.println("RX Quality:" + bb.getInt());
System.out.println("Frequent Hopping:" + bb.getInt());
System.out.println("Last registered network:" + getStringFromBytes(bb,
20));
System.out.println("TMSI:" + getStringFromBytes(bb, 20));
System.out.println("Periodic Location Update Value:" + bb.getInt());
System.out.println("BAND:" + bb.getInt());
System.out.println("Channel In USe:" + bb.getInt());
System.out.println("RSSI 1:" + getStringFromBytes(bb, 20));
System.out.println("Last cell release cause:" + bb.getInt());
The getStringFromBytes method:
private static String getStringFromBytes(ByteBuffer buffer, int
length)
{
byte[] bytes = new byte[length];
buffer.get(bytes, buffer.arrayOffset(), 20);
return new String(bytes);
}
Fortunately HTC FieldTest displays the fields in the exact same order
as their appear in the raw byte response.
The output is something like:
ARFCN: 0
LAC: 0002
RAC: 2d
MNC/MCC:26801
RSSI:17
Ncell Info1:0 -99
Ncell Info2:0 -99
Ncell Info3:0 -99
Ncell Info4:0 -99
Ncell Info4:0 -99
Ncell Info6:0 -99
RX Quality:17
Frequent Hopping:0
Last registered network:26801
TMSI:58d7cbb5
Periodic Location Update Value:1530
BAND:255
Channel In Use:255
RSSI 1:0
Last cell release cause:255
3. Now, to actually execute invokeOemRilRequestRaw
This was accomplished by changing RadioInfo.java (in
com.android.settings, the Settings apps).
I've found no other way to access the Phone. I've tried developing a
new app,
but failed to get a reference to the phone. The following method
fails:
phone = PhoneFactory.getDefaultPhone();
It returns: "PhoneFactory.makeDefaultPhones must be called from Looper
thread".
HTC FieldTest somehow manages to do it, probably because it runs as
system (it shares user id with com.android.phone,
using the sharedUserId attribute in the manifest).
Either way, I've added a bit of code to RadioInfo.java:
byte[] init1;
byte[] init2;
byte[] gsm_page;
byte[] finish;
init1 = hexStringToBytes("0000000008000000010000005f000000");
init2 = hexStringToBytes("0100000000000000");
gsm_page = hexStringToBytes("0200000000000000");
finish = hexStringToBytes("0000000008000000000000005f000000");
phone.invokeOemRilRequestRaw(init1,
mHandler.obtainMessage(EVENT_RAW));
phone.invokeOemRilRequestRaw(init2,
mHandler.obtainMessage(EVENT_RAW));
phone.invokeOemRilRequestRaw(gsm_page,
mHandler.obtainMessage(EVENT_RAW_GSM_PAGE));
phone.invokeOemRilRequestRaw(finish,
mHandler.obtainMessage(EVENT_RAW));
And also changed the mHandler:
case EVENT_RAW:
ar= (AsyncResult) msg.obj;
if (ar.exception == null) {
byte[] bytes = (byte[]) ar.result;
updateRaw(bytes);
} else {
mNeighboringCids.setText("unknown");
}
break;
case EVENT_RAW_GSM_PAGE:
ar= (AsyncResult) msg.obj;
if (ar.exception == null) {
byte[] bytes = (byte[]) ar.result;
updateRawGsmPage(bytes);
} else {
mNeighboringCids.setText("unknown");
}
break;
And added the methods:
private final void updateRaw(byte[] bytes) {
mNeighboringCids.append("\n" + bytesToHexString(bytes));
}
private final void updateRawGsmPage(byte[] bytes) {
ByteBuffer bb = ByteBuffer.wrap(bytes);
bb.order(ByteOrder.LITTLE_ENDIAN);
mNeighboringCids.append("\nARFCN: " + bb.getInt());
mNeighboringCids.append("\nLAC: " + getStringFromBytes(bb, 20));
mNeighboringCids.append("\nRAC: " + getStringFromBytes(bb, 20));
mNeighboringCids.append("\nMNC/MCC:" + getStringFromBytes(bb,
20));
mNeighboringCids.append("\nRSSI:" + bb.getInt());
mNeighboringCids.append("\nNcell Info1:" + getStringFromBytes(bb,
20));
mNeighboringCids.append("\nNcell Info2:" + getStringFromBytes(bb,
20));
mNeighboringCids.append("\nNcell Info3:" + getStringFromBytes(bb,
20));
mNeighboringCids.append("\nNcell Info4:" + getStringFromBytes(bb,
20));
mNeighboringCids.append("\nNcell Info4:" + getStringFromBytes(bb,
20));
mNeighboringCids.append("\nNcell Info6:" + getStringFromBytes(bb,
20));
mNeighboringCids.append("\nRX Quality:" + bb.getInt());
mNeighboringCids.append("\nFrequent Hopping:" + bb.getInt());
mNeighboringCids.append("\nLast registered network:" +
getStringFromBytes(bb, 20));
mNeighboringCids.append("\nTMSI:" + getStringFromBytes(bb, 20));
mNeighboringCids.append("\nPeriodic Location Update Value:" +
bb.getInt());
mNeighboringCids.append("\nBAND:" + bb.getInt());
mNeighboringCids.append("\nChannel In USe:" + bb.getInt());
mNeighboringCids.append("\nRSSI 1:" + getStringFromBytes(bb, 20));
mNeighboringCids.append("\nLast cell release cause:" +
bb.getInt());
}
So when I execute Settings (by calling *#*#4636#*#*) and go to Phone
Information I get, in the mNeighboringCids text field, the GSM Page
data.
I've checked the execution with "logcat -b radio", it's the same as
FieldTest.
Knowing that this works, we can consider changes to the Telephony API
(android.telephony).
The idea is to make this information available, through the framework,
to all apps.
Joao MG
On Feb 8, 9:03 am, Liam Alford <liamjamesalf...@googlemail.com> wrote:
> This thread was dedicated to doing so, but it appears to have gone quiet.
> What info are you after?
>
> On Fri, Feb 5, 2010 at 9:02 PM, Mark Sebik <markse...@gmail.com> wrote:
> > Oh. Thanks. Any luck getting at this info in other ways?
>
> > On Fri, Feb 5, 2010 at 3:10 PM, Liam Alford <l...@smithmyers.com> wrote:
>
> >> Its not open source. Its a htc application.
>
> >> On 5 Feb 2010 15:45, "mobot" <markse...@gmail.com> wrote:
>
> >> Has anyone located the Field Test in the source? Please let me know.
>
> >> On Jan 11, 4:56 am, Ricardo Silva <ban...@gmail.com> wrote:
> >> > I want to, for example, turn off the ...
> >> --
>
> >> You received this message because you are subscribed to the Google Groups
> >> "android-platform" group.
> >> ...
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "android-platform" group.
> >> To post to this group, send email to android-...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> android-platfo...@googlegroups.com<android-platform%2Bunsu...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/android-platform?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "android-platform" group.
> > To post to this group, send email to android-...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > android-platfo...@googlegroups.com<android-platform%2Bunsu...@googlegroups.com>
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
The problem was: "I've found no other way to access the Phone. I've
tried developing a new app, but failed to get a reference to the
phone." (this problem appears in runtime)
Then I used "make Settings" to build and "adb install" to replace the
Settings app in the ADP1.
Liam, yes, that's probably true. However, making this information
available in the framework could serve as an incentive to other OEMs
to support similar functionality.
It could also spark a discussion on implementing access to this data
as specific RIL_REQUESTs (similar to the ones for
RIL_REQUEST_NEIGHBORING_CELL_IDS, RIL_REQUEST_SIGNAL_STRENGTH, etc ).
For HTC's this is a good thing, it differentiates them from other
OEMs.
On Feb 22, 4:37 pm, Liam Alford <liamjamesalf...@googlemail.com>
wrote:
> ...
>
> read more »
I've also tried to change the /data/system/packages.xml file inside
ADP1, in order for my app to match HTC FieldTest settings. Nothing
worked. Always that "PhoneFactory.makeDefaultPhones must be called
from Looper thread"" message...
I'll open a new thread on this subject. A separate app it would be
much easier to test/debug the various data pages (GSM, GPRR, etc).
Right now I have to make the Settings app. And in order to install and
replace the previous one I need a to reboot the ADP1... a long dev
cycle.
1. compile your app which makes use of the internal classes within a
firmware build. I use:
com.android.internal.telephony.PhoneFactory.getDefaultPhone()
...to get an instance of com.android.internal.telephony.PhoneProxy.
Note this changed between 1.5 and 1.6 - in 1.5 it was possible to get
a ref to a full Phone obj. Fortunately the PhoneProxy does still
contain a lot of methods and does contain the invokeOemRilRequestRaw
for the field test strings. I am able to recompile this app
individually without needing to recompile the whole firmware.
2. Set your AndroidManifest.xml sharedUserId:
android:sharedUserId="android.uid.system"
3. You may need to specify additional permissions such as:
<uses-permission
android:name="android.permission.MODIFY_PHONE_STATE" />
4. In my case I use the internal API calls within a Service. Therefore
in the AndroidManifest.xml I set the Service to run inside the phone
app process:
android:process="com.android.phone"
5. Compile your app using the public SDK. In this version make the
relevant class(es) stubs which just create an object and don't do
anything. There should be no ref to the internal classes here.
6. Go to <app>/bin/yourapp.apk. Unzip it into app/bin/tmp. You will
see a classes.dex file.
7. Go to <app>/bin. You will see com/* which contains all the classes
compiled against the public SDK. Copy the .class files containing refs
to the internal telephony APIs in your firmware build version into the
public version. Only copy the classes over the ones for which you
previously created stub classes.
8. jar up the classes in the version compiled against the public SDK
with the classes injected from the private firmware build in <app>/
bin.
9. Run dx on the jar to generate a new classes.dex file. I use the dx
in the firmware source tree in <source>/out/host/linux-x86/bin/dx like
this:
<source>/out/host/linux-x86/bin/dx -JXms16M -JXmx1536M --dex --
output=./classes.dex ./classes.jar
10. Copy this over the classes.dex in the previously unzipped .apk in
<app>/bin/tmp.
11. Zip up the tmp directory to create a new .apk.
12. Sign the .apk with the ADP1 test keys from the firmware build.
<source>/out/host/linux-x86/framework/signapk.jar <source>/build/
target/product/security/platform.x509.pem <source>/build/target/
product/security/platform.pk8 your-modded-app.apk your-modded-app-
signed.apk
The techniques listed here work for me on an ADP1 using the stock 1.6
firmware image from http://developer.htc.com/adp.html. I believe that
the .apk would also work on normal HTC Android devices providing that
the app is signed with the same platform keys used to sign the
customer firmware. I have tried to contact HTC regarding this but have
not been able to get a response yet. I think Android needs an
equivalent of Symbian Signed hosted by Google where additional device
manufacturer specific permissions can be applied for from a central
site.
chris
> >> > >> System.out.println("Last registerednetwork:" +
> >> > >> Last registerednetwork:26801
> ...
>
> read more »
The techniques listed here work for me on an ADP1 using the stock 1.6
firmware image from http://developer.htc.com/adp.html. I believe that
the .apk would also work on normal HTC Android devices providing that
the app is signed with the same platform keys used to sign the
customer firmware. I have tried to contact HTC regarding this but have
not been able to get a response yet. I think Android needs an
equivalent of Symbian Signed hosted by Google where additional device
manufacturer specific permissions can be applied for from a central
site.
I agree that having to run in the phone process is not a good solution
but really the point I'm making is that this is the only practical
solution right now. A better approach would be to significantly
enhance the public TelephonyManager class which currently enables apps
to register for signal and cell events. For example I need items such
as the telephony disconnect cause and the data reject code which are
accessible from the internal APIs I have used and could reasonably be
added to the public SDK because they are both based on the standard AT
+CMEE modem command. The HTC Field Test strings detailed previously in
this thread are more tricky to make public because they are modem
specific. However the Android platform could specify a framework for
the retrieval of this engineering mode data and the device
manufacturer could supply an add on system component which itself runs
in the phone process like the HTC Field Test app and make this
accessible to the public TelephonyManager.
The overall aim is to provide operators with detailed data on how real
customer devices are interacting with their network. I see software
defined radio as being a major advancement enabling features such as
frequency flexibility and the ability to tailor the radio experience
to a much more granular level rather than the generic one size fits
all approach that currently exists. Both the device radio and network
radio could be more adaptive. A key part of this is to be able to
analyze the daily experience on device for a large number of users
over a large period of time.
I think these elements benefit the device manufacturer, the operator
and ultimately the customer. From my point of view all I can do is
keep trying to find a way to get at this data on real customer phones.
Joao mentioned previously a new standard AT command AT+CPOS which may
help a lot:
I listed the internal API calls to get the disconnect and reject codes
here:
http://code.google.com/p/android/issues/detail?id=700#c16
chris
The oem raw requests used by HTC FieldTest seem too vendor specific to
fit the framework.
This could be a good solution:
"However the Android platform could specify a framework for the
retrieval of this engineering mode data and the device manufacturer
could supply an add on system component which itself runs in the phone
process like the HTC Field Test app and make this accessible to the
public TelephonyManager."
It would provide a standard way to extend the android platform ( an
HTC shared library API to fetch the gsm/umts info pages ).
Joao MG
> http://groups.google.com/group/android-platform/browse_thread/thread/...
I'm trying to get the 3g fields... and I don't know what byte[] the
"invoke" method is expecting..
Thanks!
Uri.
Hi,
I'm interested in fetching low level Radio network information: rxLev,
rxQual, BSIC, BCCH, and other GSM/UMTS network info.
Basic data, such as cellid and location area code is already available
from the SDK API (android.telephony.gsm.GsmCellLocation).
However, detailed Radio network behaviour and information is not
available.
My question: is there a way to fetch this information? Perhaps from
ril / rild?
In order to make add these changes to the Android source code (SDK),
where should I start to look?
- ril / rild (C platform code)
- Telephony (Java / SDK API code)
- Phone and Dialer app's (Java / application code)
HelloDoes anybody know, if the device must be rooted to read these low level network information?My little app is nice running on my HTC magic 32B (second developer phone). Now I tested it on my new HTC One X and I get the message:Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE]I also found the HTC FieldTest app for the HTC One XL but I can't install it on my device. I get the same error:Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE]You can download the FieldTest here, if anybody needs it:Would be happy for any hints.Felix
Am Samstag, 23. Juni 2012 01:50:25 UTC+2 schrieb Damien O'Reilly:Can you share your code please?Im having trouble with reflection as im targeting SDK 2.3.3
--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/rB-1saKQ0gkJ.
--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/V71xddOUvjsJ.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/tyZrnzoA4pMJ.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/IQEJwL5iZsAJ.
>>>> Sábado, 7 de Julho de 2012 9:13:24 UTC+1, FelixG
>>>> > > I am running João code too. I have
> >>>> S�bado, 7 de Julho de 2012 9:13:24 UTC+1, FelixG
> >>>> > > I am running Jo�o code too. I have
--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/L5lDh2SeJ5oJ.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
How do I make the phone run in debug mode?
So, I fetched the framework.jar from rooted android device which is targated for my project and decompiled it to get all the class files then converted RIL.class to RIL.java & edited as described in the given post. But I got stuck on how to compile RIL.java (as it have dependencies of hidden files) to again make modified framework.jar.
I will then call invokeOemRilRequestRaw() of RIL class from my application to get the output from modified RIL.java.
Any pointer will be highly appreciated.
Please correct me if I am on wrong track.
Hi Chris,What do you mean RCC states are available using 0a00000000000000? Is this an address and how to access it?Thanks,Andong
To unsubscribe from this group and stop receiving emails from it, send an email to android-platfo...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-platform?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
( very long post)After a long interval, back to Android RIL.
I've managed to fetch and parse a GSM Page request from the ril.
Using invokeOemRilRequestRaw method in
com.android.internal.telephony.Phone.The approach was:
1. retrieve sample raw responses from logcat -b radio
This was done by a small change the method retToString in RIL.java:
} else if (ret instanceof byte[]) {
byte[] bytes = (byte[]) ret;
s = IccUtils.bytesToHexString(bytes);This way the invokeOemRilRequestRaw raw bytes response is written to
the log (converted to an hex string).2. After reading the log, parse the GSM Page response:
D/RILJ ( 141): [0168]> OEM_HOOK_RAW[0200000000000000]
D/RILJ ( 141): [0168]< OEM_HOOK_RAW
000000003030303200000000000000000000000000000000326400000000000000000000000000000000000032363830310000000000000000000000000000001100000030202d393900000000000000000000000000000030202d393900000000000000000000000000000030202d393900000000000000000000000000000030202d393900000000000000000000000000000030202d393900000000000000000000000000000030202d3939000000000000000000000000000000110000000000000032363830310000000000000000000000000000003538643763626235000000000000000000000000fa050000ff000000ff0000003000000000000000000000000000000000000000ff000000So the first line is the GSM Page request, the second is the byte
response (both byte arrays converted to hex strings).So, now we can parse this into meaningful information using:
ByteBuffer bb = ByteBuffer.wrap(bytes);
bb.order(ByteOrder.LITTLE_ENDIAN);
System.out.println("ARFCN: " + bb.getInt());
System.out.println("LAC: " + getStringFromBytes(bb, 20));
System.out.println("RAC: " + getStringFromBytes(bb, 20));
System.out.println("MNC/MCC:" + getStringFromBytes(bb, 20));
System.out.println("RSSI:" + bb.getInt());
System.out.println("Ncell Info1:" + getStringFromBytes(bb, 20));
System.out.println("Ncell Info2:" + getStringFromBytes(bb, 20));
System.out.println("Ncell Info3:" + getStringFromBytes(bb, 20));
System.out.println("Ncell Info4:" + getStringFromBytes(bb, 20));
System.out.println("Ncell Info4:" + getStringFromBytes(bb, 20));
System.out.println("Ncell Info6:" + getStringFromBytes(bb, 20));
System.out.println("RX Quality:" + bb.getInt());
System.out.println("Frequent Hopping:" + bb.getInt());
System.out.println("Last registered network:" + getStringFromBytes(bb,
20));
System.out.println("TMSI:" + getStringFromBytes(bb, 20));
System.out.println("Periodic Location Update Value:" + bb.getInt());
System.out.println("BAND:" + bb.getInt());
System.out.println("Channel In USe:" + bb.getInt());
System.out.println("RSSI 1:" + getStringFromBytes(bb, 20));
System.out.println("Last cell release cause:" + bb.getInt());
The getStringFromBytes method:
private static String getStringFromBytes(ByteBuffer buffer, int
length)
{
byte[] bytes = new byte[length];
buffer.get(bytes, buffer.arrayOffset(), 20);
return new String(bytes);
}Fortunately HTC FieldTest displays the fields in the exact same order
as their appear in the raw byte response.The output is something like:
ARFCN: 0
LAC: 0002
RAC: 2d
MNC/MCC:26801
RSSI:17
Ncell Info1:0 -99
Ncell Info2:0 -99
Ncell Info3:0 -99
Ncell Info4:0 -99
Ncell Info4:0 -99
Ncell Info6:0 -99
RX Quality:17
Frequent Hopping:0
Last registered network:26801
TMSI:58d7cbb5
Periodic Location Update Value:1530
BAND:255
Channel In Use:255
RSSI 1:0
Last cell release cause:2553. Now, to actually execute invokeOemRilRequestRaw
This was accomplished by changing RadioInfo.java (in
com.android.settings, the Settings apps).I've found no other way to access the Phone. I've tried developing a
new app,
but failed to get a reference to the phone. The following method
fails:phone = PhoneFactory.getDefaultPhone();
It returns: "PhoneFactory.makeDefaultPhones must be called from Looper
thread".HTC FieldTest somehow manages to do it, probably because it runs as
system (it shares user id with com.android.phone,
using the sharedUserId attribute in the manifest).Either way, I've added a bit of code to RadioInfo.java:
byte[] init1;
byte[] init2;
byte[] gsm_page;
byte[] finish;init1 = hexStringToBytes("0000000008000000010000005f000000");
init2 = hexStringToBytes("0100000000000000");
gsm_page = hexStringToBytes("0200000000000000");
finish = hexStringToBytes("0000000008000000000000005f000000");phone.invokeOemRilRequestRaw(init1,
mHandler.obtainMessage(EVENT_RAW));
phone.invokeOemRilRequestRaw(init2,
mHandler.obtainMessage(EVENT_RAW));
phone.invokeOemRilRequestRaw(gsm_page,
mHandler.obtainMessage(EVENT_RAW_GSM_PAGE));
phone.invokeOemRilRequestRaw(finish,
mHandler.obtainMessage(EVENT_RAW));And also changed the mHandler:
case EVENT_RAW:
ar= (AsyncResult) msg.obj;
if (ar.exception == null) {
byte[] bytes = (byte[]) ar.result;
updateRaw(bytes);
} else {
mNeighboringCids.setText("unknown");
}
break;
case EVENT_RAW_GSM_PAGE:
ar= (AsyncResult) msg.obj;
if (ar.exception == null) {
byte[] bytes = (byte[]) ar.result;
updateRawGsmPage(bytes);
} else {
mNeighboringCids.setText("unknown");
}
break;And added the methods:
private final void updateRaw(byte[] bytes) {
mNeighboringCids.append("\n" + bytesToHexString(bytes));
}private final void updateRawGsmPage(byte[] bytes) {
ByteBuffer bb = ByteBuffer.wrap(bytes);
bb.order(ByteOrder.LITTLE_ENDIAN);mNeighboringCids.append("\nARFCN: " + bb.getInt());
mNeighboringCids.append("\nLAC: " + getStringFromBytes(bb, 20));
mNeighboringCids.append("\nRAC: " + getStringFromBytes(bb, 20));
mNeighboringCids.append("\nMNC/MCC:" + getStringFromBytes(bb,
20));
mNeighboringCids.append("\nRSSI:" + bb.getInt());
mNeighboringCids.append("\nNcell Info1:" + getStringFromBytes(bb,
20));
mNeighboringCids.append("\nNcell Info2:" + getStringFromBytes(bb,
20));
mNeighboringCids.append("\nNcell Info3:" + getStringFromBytes(bb,
20));
mNeighboringCids.append("\nNcell Info4:" + getStringFromBytes(bb,
20));
mNeighboringCids.append("\nNcell Info4:" + getStringFromBytes(bb,
20));
mNeighboringCids.append("\nNcell Info6:" + getStringFromBytes(bb,
20));
mNeighboringCids.append("\nRX Quality:" + bb.getInt());
mNeighboringCids.append("\nFrequent Hopping:" + bb.getInt());
mNeighboringCids.append("\nLast registered network:" +
getStringFromBytes(bb, 20));
mNeighboringCids.append("\nTMSI:" + getStringFromBytes(bb, 20));
mNeighboringCids.append("\nPeriodic Location Update Value:" +
bb.getInt());
mNeighboringCids.append("\nBAND:" + bb.getInt());
mNeighboringCids.append("\nChannel In USe:" + bb.getInt());
mNeighboringCids.append("\nRSSI 1:" + getStringFromBytes(bb, 20));
mNeighboringCids.append("\nLast cell release cause:" +
bb.getInt());
}So when I execute Settings (by calling *#*#4636#*#*) and go to Phone
Information I get, in the mNeighboringCids text field, the GSM Page
data.I've checked the execution with "logcat -b radio", it's the same as
FieldTest.Knowing that this works, we can consider changes to the Telephony API
(android.telephony).The idea is to make this information available, through the framework,
to all apps.Joao MG
On Feb 8, 9:03 am, Liam Alford <liamjamesalf...@googlemail.com> wrote:
> This thread was dedicated to doing so, but it appears to have gone quiet.
> What info are you after?
>
> On Fri, Feb 5, 2010 at 9:02 PM, Mark Sebik <markse...@gmail.com> wrote:
> > Oh. Thanks. Any luck getting at this info in other ways?
>
> > On Fri, Feb 5, 2010 at 3:10 PM, Liam Alford <l...@smithmyers.com> wrote:
>
> >> Its not open source. Its a htc application.
>
> >> On 5 Feb 2010 15:45, "mobot" <markse...@gmail.com> wrote:
>
> >> Has anyone located the Field Test in the source? Please let me know.
>
> >> On Jan 11, 4:56 am, Ricardo Silva <ban...@gmail.com> wrote:
> >> > I want to, for example, turn off the ...
> >> --
>
> >> You received this message because you are subscribed to the Google Groups
> >> "android-platform" group.
> >> ...
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "android-platform" group.
> >> To post to this group, send email to android-...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/android-platform?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "android-platform" group.
> > To post to this group, send email to android-...@googlegroups.com.
> > To unsubscribe from this group, send email to
Hi FelixGI met the same problem in the beginning (Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE]). Thanks to your update, I use the same way to push FieldTest.apk under /system/app/. Now here's a question, how can I launch this app? I tried
am start -a android.intent.action.MAIN -n com.htc.fieldtest/.FieldTest
But a error came out:Starting: Intent { act=android.intent.action.MAIN cmp=com.htc.fieldtest/.FieldTest }
Error type 3
Error: Activity class {com.htc.fieldtest/com.htc.fieldtest.FieldTest} does not exist.PS. I use rooted At&t HTC One X and the software number is 2.20.502.7 710RDThanks,Andong
Hi Shrawan Gupta,
How do you instantiate/call mHandler?
i am able to access Phone object. I know what commandstring to pass for invokeOemRILRequestString(), but i do not know what to pass for msg.
Thank you
Hello i am working on a project ( https://github.com/SecUpwN/Android-IMSI-Catcher-Detector ) and we are looking for the same answers like you :) and we still need developers! Is there a solution to get informations about the cipher indicator or the current used encryption standard (if A/0)?
> >> --
>
> >> You received this message because you are subscribed to the Google Groups
> >> "android-platform" group.
> >> ...
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "android-platform" group.
> >> To post to this group, send email to android-...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/android-platform?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "android-platform" group.
> > To post to this group, send email to android-...@googlegroups.com.
> > To unsubscribe from this group, send email to