Hi I am developing a mobile application where I need to access the phonebook of the users, SIM and phone contacts.
Is this possible?
Depends on the handset, some only let you access phone contacts, some do both phone and sim. Make sure you iterate over all the PIMLists supplied by PIM.listPIMLists(), often this method returns two lists, one of which will be phone, the other will be sim.
Yeah its possible. Look on this discussion on Nokia forum. Here it will be described clearly about how to get the contacts from phone and sim.
You can access the contacts using the following API
JSR 75: PDA Optional Packages for the J2METM Platform
http://www.jcp.org/en/jsr/detail?id=75
This is an optional package & maynot be there for all the mobile devices.
You can check the following URL for the sample programs
http://developers.sun.com/mobility/apis/articles/pim/index.html
http://www.java2s.com/Code/Java/J2ME/PersonalInformationManager.htm
Use the following code to check whether the device supports PIM or not :
String currentVersion = System.getProperty("microedition.pim.version" )
if the device is not supported then it will return null.
Related
I am new to Asterisk. We re working on an IVR project in University and we have some queues in queues.conf file. Some of our queue members are not registered in asterisk and we re calling them via trunk. But the problem is that we cant get the DEVICE_STATE information of these devices that is noıt registered in asterisk.
For example when we use Verbose function to see the state of a device; Verbose(${DEVICE_STATE(SIP/XXXX#10.0.0.2)}) it says the phone is INVALID.
But on the other hand we can call this phone via trunk. Is there any way to get the DEVICE_STATE of a phone which is not registered in asterisk and calling with trunk.
Thanks and Regards
you can not use DEVICE_STATE to make a call for external devices.
The short version is no, not that I am aware of. If the device is not registered, then Asterisk literally has no stateful information of the device. Therefore, until Asterisk has some reason to "talk to" the SIP device in question, it doesn't even know if it's on the network. A few quick Google searches didn't even show a way to do a pre-call SIP status enquiry.
Recommended Reading:
https://wiki.asterisk.org/wiki/display/AST/Function_DEVICE_STATE
http://asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/usingCustomDeviceStates.html
The latest Facebook iOS SDK (3.2) includes native methods for sending AppRequests to a user's friends via the FBWebDialogs class. Does it have any way to filter the recipients' list to friends that use iOS devices? Does Facebook keep any sort of database with these relationships?
Answering my own question - you can add 'devices' to the 'fields' parameter when querying the user's friends, create your own custom friend picker for app requests which parses users based on their devices, and send the list you build as a parameter to apprequests.
I want to generate universally unique id for registration process of my j2me application. i came across following approaches for that
IMEI no of device Getting IMEI and IMSI in Java ME this approach doesn't work on most of devices. Problem with IMEI is is not that easy to get it from Midlet for most of models.
Bluetooth device address Getting Bluetooth Address
Problem Needs support for Bluetooth API and will limit no of devices app can run on.
UUID class
Problem Need Bluetooth API as it is in javax.bluetooth package same prob
The registration process used by my company for their android app is as follows
customer mobile will send IMEI no and Token provided by company to server using SMS
Server will send licence key to customer mobile which will be stored in customer mobile
And i have to follow the same approach for j2me application
One solution can be getting unique id from server through SMS. but company uses above registration process.
Is there any other approch that i can use for registraing my application or is there any way to overcome above problems.
I agree with #funkybro that a Jad key with a unique ID provided by the server would solve the issue. But if its not possible I would create an id based on mobile time and a hash code.
long time = System.currentTimeMillis();
StringBuffer id = new StringBuffer(Long.toString(time, 16).toUpperCase());
id.append(Integer.toHexString(new Object().hashCode()).toUpperCase());
If this id is duplicated the registration process fails and the application is asked for a new id.
You can put a server generated unique ID in the jad at deploy time.
My idea is to make an application start automatically when a message from a specific user reaches the inbox of the mobile . For example if my friend sends some numbers to my mobile, the sms has to be read and validated first and then calculator ( inbuilt mobile application) has to be triggered and process the numbers from the message. Please help me with the above query.
I am far from convinced you will be able to give the phone user access to the same sms you use to launch your MIDlet.
You may need to use native development on the phones that support it if J2ME can't give you exactly what you need.
In any case, you probably want to try with J2ME first so you need to read the specifications for JSR-118 and its PushRegistry API, along with JSR-120, which interfaces with SMS.
Most current J2ME-enabled phones will support static SMS Push but you will need to send the SMS to a particular port, much like you would data over a standard library socket.
I don't think you can trigger on just any old SMS message arriving.
This is the class you want to look at, in any case:
javax.microedition.io.PushRegistry
Can we send SMS programatically by selecting group from the address book using J2me?
yes... it is possible to have access to the users phonebook (if supported on the device(most modern devices do allow it)) via PIM(JSR 75).
And sending SMS's from j2me is also possible(again if the user allows this).
It turns out you can only send a single message to a single recipient at a time using JSR-205.
If you want to send the same message to many recipients, you have to loop around
javax.wireless.messaging.Message.setAddress();
javax.wireless.messaging.MessageConnection.send();
There is no way to add a javax.microedition.pim.ContactList to a Message or to a MessageConnection because there can't be any API dependancy between JSR-205 and JSR-75.
The latest JavaME SDK contains example code that shows how to read contact data in a MIDlet.