How I can get the UUID of an Android device by JNI - java

I am developing a dynamic library for Android devices by JNI. And I have to get the UUID of the device without using of the Android APIs. I have tried to get the CPU Serial Number or MAC Address via Shell Scrip. such as:
cat /proc/cpuinfo
cat /sys/class/net/wlan0/address
But the Serial Number is always 0000000000000, And there is no wlan0 folder in my phone. Now I am so lost, can anybody give me some tips!

Related

How to get usbhub serial number / metadata using Java in Mac OS X

So what i'm trying to do is get the serial number for a usb to serial converter. I have an FTDI FT232 usb to serial computer connected to a Mac OSX and i would like to read the metadata for that usb to serial interface.
In Mac OSX the FTDI FT232 usb to serial converter shows up under USB subsection in System Information.
Is there a way to read this metadata information that is presented here, using Java.
Under windows similar information is presented in the device manager and can be accessed through the windows registry. I am wondering if there is a way similar to that for accessing this metadata.
Thanks.
You can iterate over the USB hierarchy using a command line tool. I described the process in another post.

Java: Get USB Mass Storage Device Information

is there a possibility to get USB mass storage information like the serial of an USB device in Java on Windows?
I tried to achieve that with USB4Java (low and high-level API) and it works, but the problem is that I have to install a customized driver to get access to the information from my Java app (described in the FAQ at http://usb4java.org/). When that special driver (created with Zadig) is installed I don't have any further access to the device from the Windows explorer (just from my Java app).
I would like to detect when a new USB device is attached and if it was attached, I would like to get some information like the serial number of the device, the device name, the drive letter that was assigned etc.
That app should be used by other users and I couldn't force them to create a customized driver for each device ...
Do you have any hints how to achieve that?
Thanks.
Edit: Is it possible to get the usb-port of a connected device with Java-built-in methods?
I've tried sth with FileSystemView.getFileSystemView().getSystemDisplayName() but there are no such options. Is there another possibility to get vendor id's or sth. similiar with Java?
Or is it possible to get the drive letter with USB4Java?
Thanks.

Data from USB ~ Serial Port

I would like to transfer data from a USB Host (of my Laptop or Android Device) to Serial COM port (of a Desktop PC) through a USB - Serial port(DB-9) adapter.
Is there any library existed to do this task??
i have already studied and tried http://developer.android.com/guide/topics/connectivity/usb/host.html but failed.
Can i send data by a using a java program or Android App from my Laptop or Android Device ??
Can i receive data by an app in Desktop PC and show us????
If so please guide me how.
Yes, this is possible, the implementation will depend on what device you pick.
Check out the usb-serial-for-android project for the communication from Android to the USB device. This has support for most major USB to UART Bridge devices such as a Silicon Labs, Prolific, FTDI and CDC Class devices.
You can talk to it as a serial device from your laptop computer using normal serial communications such as POSIX method for Linux or OSX or the Commuincations API for Windows.

how to read sms from sim dongle using java code and AT commands?

I want to read sms from sim which is connected to my laptop by dongle(USB connector) using java code, I know that I have to use AT commands but I don't know which commands and how ???
If you are using Windows 7 and a reasonably new modem, you don't have to use AT commands. You can use the Windows Mobile Broadband API (it is available from Win 7 onwards).
It includes interface functions for SMS.
You need to enable a serial data connection via the USB connector to your GSM device/phone.
You will also need some type of terminal emulation software to connect and communicate to your phone.
You did not say what Operating system/Hardware you were trying to do this from, or what model of phone, this can affect the AT command set you need to use to access the SMS info, so I can't be more specific.
I have done this a few years ago using a bluetooth connection to a Motorola Razor from a mac Laptop, using a small Realbasic program to send and recieve SMS messages as a proof of concept for sending server monitoring messages to IT staff via sms. You can google the AT for GSM command set.

Android 2.3.4 FTDI D2xx Driver for TTL-232R

I have been trying to get the FTDI D2xx driver working with my Android 2.3.4 tablet for a while now. After solving a number issues relating to actually loading the driver I am now in a situation where the FTDI device is just not seen by the sample application FTDI provides.
There are no errors reported in either LogCat or Java (debug) the device is just simply not found.
Java_com_ftdi_D2xx_getDeviceInfoList() returns zero.
The tablet is rooted, and the permissions for the ueventd.rc file are set to:
/dev/bus/usb/* 0666 root usb
The USB port I have connected my TTL-232R to does work (in that I can read a USB memory stick with it at least...)
Has anyone else experimented with this and/or got it working? If so some pointers would be greatly appreciated!
Many thanks
Does 2.3.4 support USB Host?
http://developer.android.com/sdk/android-2.3.4.html
No USB host support — Android 2.3.4 and the Open Accessory Library do not support USB host mode (for example, through UsbDevice), although USB host mode is supported in Android 3.1. An Android-powered device running Android 2.3.4 can not function as a USB host. The library enables the Android-powered device to function as a peripheral only, with the connected accessory functioning as USB host (through UsbAccessory).
I've got the sample working with ICS.
Well, I must manually switch from USB peripherals to USB host and vice versa in terminal emulator, since stock kernel does not support otg, custom kernel support otg, but not turn it on automaticly.
cmd1="echo host > /d/otg/mode"; // usb otg host on
cmd2="cat /d/otg/info</"; // check usb status, must be usb a_host and otg=1
cmd3="echo peripheral > /d/otg/mode"; // usb oth host off

Categories