Detected android device connected to PC - java

I have an android devic, i wish to know when it is connected to the pc via java/.net
i know its possible - the Samsung New PC Studio is doing it, when ever i connect an android device it lets me know. how can i achieve the same?

You have to listen for one of this notifications
http://developer.android.com/reference/android/content/Intent.html
If you're using it as a mass storage device then use this
http://developer.android.com/reference/android/content/Intent.html#ACTION_UMS_CONNECTED
Other USB events aren't clearly described in the documentation
EDIT:
If you want to read on the computer side I would read this article
http://today.java.net/article/2006/07/05/java-and-usb
and then check which kind of devices are connected to the usb port. if it is a mobile phone, then you can try to send a short message to it. on your phone you make a small piece of code which returns an appropriate answer so you can detect thats its really android/your phone/this phones you want to identify

java device detection
This site have a guide on how to detect device with java web and java core
http://51degrees.com/Support/Documentation/Java/GettingStarted.aspx

Related

Bluetooth HID in Android (Java)

I have a Wii remote and I want to connect it to my android phone with just Java if possible. I have tried to look for libraries and other things like that but there was nothing. I am new to Bluetooth development, I don't know how it works entirely. Other than that, I would love to get some links on how to connect a Bluetooth device as an HID and send data to a specific address. Thank you all!!!!

How to know the number of devices connecting to current Wifi AP (Android & iOS)

I want to make a app to count the number of mobile devices under the current Wifi Access Point.
But it seems there is no API for that.
Here's an example for you to get a list of connected clients to hotspot in Android: http://www.whitebyte.info/android/android-wifi-hotspot-manager-class
What Api have you tried ? you can try this https://code.google.com/p/iphone-wireless/wiki/Stumbler. You can see LINK here as well.

Android USB read/write is working only by reconnecting cable

I am working with Java Eclips, galaxy tab 2 android 4.1.1
I have a device that is connected to the USB and I can write and read from/to it.
my problem is that I can read/write to the device only if I turn on the app by replugging the USB cable, if I close the app and try to switch it on by icon the USB is not reacting by read and write
while I try to connect to the USB I have no errors it seems like success but the write gets and exception :
"ENODEV (No such device)"
dose some one can help?
I know that there is already 2 years left since a question posted but I would like to post an answer anywhere.
You face with a well know Android USB bug
https://code.google.com/p/android/issues/detail?id=59667
What I do in this way is simple parse an error and display a Alert Dialog that it is necessary to unplug and plug USB cable.

Reading SMS from PC

Scenario : 1
Suppose there are two phones A and B. phone B sends a message to phone A. Phone A has that message in its inbox. Both the phones are nokia multimedia phones that can be connected with my laptop via nokia pc-suite.They can also be connected via Bluetooth with my HP laptop.
Scenario : 2
A valid sim card of my local operator is inserted into a modem and the modem is connected with my laptop. I can read messages sent in that number(sim) by using the software provided with the modem.
Question:
The received text message will be the input of my java program. How can I read that message with my java program. Solution for any of the two scenarios will solve my problem.
It would be very helpful for me if someone provide me some resources regarding this issue. I am interested to implement it by java but it would be also helpful if the resources are not in java platform but relevant to my task.
You can connect GSM modem built in Mobile Phone via bluetooth or RF232 connection, then send AT Commands. Pure java conenction functions should not be enough to make it possible. So you can use low level API coded by C programming language then connect it with Java applicatio via JNI.

How to access the mobile number of a device on which J2ME application is running?

I am developing an Messaging application using J2ME for which i need to access the mobile number of a device on which application is running.
I tried to find out the api's related to it but was unable to find it.
So Plz can any one tell me is there any other method to find the mobile number in J2ME?
From what I know, that's impossible, not all J2ME devices are mobile phones and even if the device running J2ME is a mobile phone its not always aware of its phone number. There are some tips and tricks to accomplish this task eg. from a way for some Nokia devices (look here) by reading some system properties ('com.nokia.mid.msisdn') to some 'silly' ways of sending an sms to a specially prepared sms receiver/sender who just replies another sms, then your application can listen to incoming sms with a specific data and read its mobile number.
Well, I think it is possible--create a SIM applet that will extract the MSISDN from one of the Elementary Files (EF) of the SIM (I am not sure which one). Then, with SATSA, make the JME application communicate with the SIM applet.

Categories