Get Cell-ID in J2ME Application - java-me

I want a common(generic) code which gives cell ID of the mobile network.
For nokia it is:
System.getProperty("com.nokia.mid.cellid");
but I need code which gives cell ID irrespective of mobile vendors.
I used System.getProperty("Cell-ID"); but this is Giving null to me.

There is no standard way to get these values and different vendors have different System properties. You can see this at http://www.easywms.com/easywms/?q=en/node/3589
Similar question at How can one acquire position in Non-Gps devices using j2me coding

Related

Search for all iBeacons and not just with specific UUID

Is it possible to search for all iBeacons which are nearby? I know it's possible to search iBeacons by UUID. But i want to find all iBeacons nearby.
An iBeacon is a region, and has as defining property the UUID. Therefore, you can only search for the ones matching a UUID.
After you find one or more with a specific UUID, you can figure out which is closest using the delegate callbacks, where the beacons are stored in an array ordered by distance.
There is great sample code on this and also a pretty detailed WWDC video session: "What's new in Core Location"
iBeacons are higher-level constructs than regular BLE peripherals. From what can be determined from the Apple docs, beacons are tied to their service UUID. i.e., a family of beacons is a "region" and a you go into and out of a region based on the range and visibility of a beacon to YOU, not the other way around. Unfortunately Apple has used the term region, which most of us probably associate with MapKit, so this is adding to the general confusion
Here's the bad news: You can only scan for ProximityUUIDs that you know, there is no "wildcard" proximityUUID. Additionally, CLBeacons don't expose the much in the way of lower level CoreBluetooth guts so if you want to find all beacons that happen to be near you, you'll have to use CoreBluetooth, scan for peripherals, then look though the returned peripheries and query each one them to find beacons. Of course Apple has neither registered (with the Bluetooth SIG) or (yet) published the iBeacon characteristics so, you'll need a BT sniffer to reverse engineer what constitutes an iBeacon from any other BLE device.
each APP would use it's own specific UUID, using the "major" and "minor" integer values to differentiate between beacons.
for example, the UUID would be associated with a chain of shops, major would identify the shop, and minor the aisle, or even a group of products.
scanning for unknown UUID's would not be very useful, as your app would not know what to do with the information.
the UUID is generated once and for all, using the "uuidgen" command in the terminal.
sadly there is no protocol to actually communicate with beacons, hence there is no standard to get the location of a beacon, or any other useful info.
it would have been so much better if we could open a connection to a beacon, usually the closest one, and obtain additional data from it, without having to be on the same WIFI network.
you either have to use bonjour to communicate with the device over WIFI, or use the major and minor id to obtain data from a webservice of some kind.
Unfortunately you cannot at this time search for an arbitrary iBeacon without first knowing the proximityUUID value. I've tried writing directly to COREBluetooth and, although you can discover and connect to transmitting beacons in your area, what you get back is jibberish with no relation to the BLE UUID. So you can't even confirm that the peripheral you have connected to is in fact an iBeacon.
This does not appear to be a limitation of the BLE spec, rather it is a limitation that has been imposed by Apple. It also appears that this limitation does not exist for the Android platform.
Until this gap is closed, Android will have a significant advantage over iOS in this area.
I disagree with previous comments that scanning for UUIDs would be useless. On the contrary, if you knew the beacon UUID, you could create a map of beacon/location/subject in the cloud and use it to navigate (assuming the beacon was fixed) using a web service. You could crowd-source the data so that eventually a very rich database of beacon UUID/location pairs would be available to all who wanted to write location apps. Perhaps this is why Apple is hiding the info; they may be holding this back for their own purposes.
According to Radius Networks (authors of the AltBeacon spec and the android-beacon-library it's not possible to identify a beacon using CoreBluetooth

Retrieving the unique device ID of Microsoft Surface

I am developing an application for Windows 8 and I am testing it on Microsoft's Surface. Does any one know how I can retrieve the unique device ID of Surface?
Just like we do for Windows Phone by retrieving its unique device id using Microsoft.Phone.Info namespace.
I use Windows.System.Profile.HardwareIdentification.GetPackageSpecificToken(null).Id converted to string, details at http://coding.kulman.sk/how-to-uniquely-identify-a-windows-8-device/
AFAIK, the closest thing you'll find (for Windows Store apps) is the ASHWID, which isn't device specific but rather app+device specific. There are a number of options you can provide in terms of weighting the different factors that comprise the ASHWID.
EasClientDeviceInformation esClientDeviceInformation=new EasClientDeviceInformation();
var localDeviceID= esClientDeviceInformation.Id;
Happy Coding:)

Generating one use only barcodes & dealing with retailers?

I have a question for those of you who have dealt with retailers in developing consumer facing apps.
I am writing an application for my grandma's bakery. I want people to write some comments/messages on her website and if they do so, then I want to generate a barcode or promo code or whatever so they can get 1 free cupcake at the bakery.
I have the site setup now to the point where I can send an email to people who logged in and wrote a comment. What is the best way to have a secure promo code/barcode so that it will only be used once? Basically, I want to generate some promo code or barcode that is one use only and it needs to be something that can either be understood by my grandma's barcode scanner. I thought about making it so she can check the promo code on my website, but internet is very spotty in her store and so it is not clear if that will work.
What is the best way to go about doing this? I guess this is mainly a security question, so I figured stack overflow would be able to help me out.
Thanks in advance!
A barcode cannot be one use without some kind of database to check up against. A barcode is scanned and it has a literal value, it does not store how many times it has been used previously.
You need some kind of software in place to log the use of a barcode, and store that information and then check each new barcode scanned against your database of used barcodes.
This does not mean she has to have an internet connection. You can generate the barcode and then prevent it's use by storing and updating the database locally.

Getting SIM ID or any Unique Number Using J2ME

I am writing an application that run only that user's phone. If the phone is stolen, application will never work anytime. For this scenario, I must used IMEI and SIM number but I develop application on SDK 60 2nd edition. So getting these numbers is not easy.
I used Bluetooth ID instead of IMEI, but I could not found any specific ID instead of SIM number. If any suggestion have been, I' d be glad. Thanks...
There are some examples on how to accomplish this with the IMEI in different phone manufacturers:
http://mobilepit.com/10/how-to-get-imei-number-in-j2me-javame.html
Seems like there's no "universal" method for any of those. In S60 (I guess this is what you mean by 'SDK 60') the appropiate code is:
System.getProperty("phone.imei");
For IMSI I think you have to get the operators signing, but you could use:
System.getProperty("com.nokia.mid.imsi");

J2ME Registration Screen

I would like to add some kind of Registration Screen to my J2ME software in order to allow users to use my app for a trial period and only give them full access after registration.
I know how to get the IMEI etc. but I wonder if there is already code out there which handles the generation of a unique phone identifier and creation of some kind of "CD-Key" for J2ME...
What a lot of downloadsites use(handango etc), is the RPN registration method.
Given a unique ID (IMEI on phones, ownerid on PocketPC, etc) you do a calculation on it which is unique for your app (for instance: add all letters together and divide by 5). This number is your unlock code.
now the user who wants to register your app, gives it's imei number to the webstore,... they pay,... and the webstore does your unique calculation. It then return the unlock code to the customer.
The customer inputs the unlock code into your app, if it matches then they payed!
The way to store this unique calculation is by virtue of RPN (Reverse Polish Notation). This is a way like how HP calculators worked. Instead of typic 4*3 and getting the answer 12, you type: 4 3 *
here is an article on the PocketPC implementation of how to implement the RPN method yourself. Lot's of webshops have the RPN calculator in their webbackend so this way you become compatible with them.

Resources