access to phone's settings : codeName one - codenameone

I would like to know if it's possible to access my phone settings using CodeNameOne. For example, if I want to get my EMEI( International Mobile Equiment Identity) or the serial number of my phone, is there a way to get it using codeNameOne?
If yes how ? if not, what alternative can I use?
thanks

We have Display.getMsisdn() & Display.getUdid() but those only work on Android and produce scary looking permission prompts.
Since this is Android specific it would make sense to code EMEI & similar calls with a native interface anyway.

Related

Fingerprint scanner in codename one

Question: 1
I want to use fingerprint scanner in codename one. Can anybody tell me is it available in codename one or not? If yes, how to use and if no, then how can I code it in codename one ?
Question: 2
How to get the maximum device info in codename one like android version, mobile model, or other stuff ?
Thanks,
No. Fingerprint scanning isn't available at this time.
You can use native interfaces to integrate native device functionality check out this quick video and the advanced section in the developer guide.
Device information is available in Display.getProperty() as well as some other methods in that class. Notice that if you get things such as UDID you will get a permission prompt.

Windows 10 UWP - How to check if Cellular data is enabled?

In Windows 10 UWP, how can I check if cellular data is enabled ?
I don't want to know what type is my current internet connection (NetworkInformation.GetInternetConnectionProfile()), I want to know if the cellular data radio is activated.
I think in Windows 8, we can do it using DeviceNetworkInformation.IsCellularDataEnabled, is there an equivalent for Windows 10 UWP ?
Thank you.
you can check this using NetworkInformation Class
https://msdn.microsoft.com/en-us/library/windows.networking.connectivity.networkinformation.getinternetconnectionprofile.aspx
ConnectionProfile networkProfile= NetworkInformation.GetInternetConnectionProfile();
if (networkProfile.IsWwanConnectionProfile)
{
WwanDataClass connection = networkProfile.WwanConnectionProfileDetails.GetCurrentDataClass();
}
I'm not sure if this will do exactly what you want, but I think you can try calling MobileBroabandAccount.AvailableNetworkAccountIds and select the first in range to get your default network account id. Then call MobileBroadbandAccount.CreateFromNetworkAccountId on that network account id and try using MobileBroadbandNetwork.NetworkRegistrationState on that network. See the MobileBroadbandNetwork documentation here and the possible fields here.
Here's my example:
Debug.WriteLine("Current network registration state is: " + MobileBroadbandAccount.CreateFromNetworkAccountId(MobileBroadbandAccount.AvailableNetworkAccountIds[0]).CurrentNetwork.NetworkRegistrationState);
I think that if your cellular data is disabled the result of this call will be Deregistered. I don't have a windows phone, but this is the case on my Windows desktop with a Mobile Broadband USB stick.
I know it's kinda of a work-around, but I'm not sure of any other way to just check if cellular data is enabled. Hope this helps in some way.
Edit
I did some more searching and found this similar thread here.
You should be able to use the answer there to solve your problem.

What mobile platforms could I reliably expect this application concept to work on?

I need the ability to do the following things:
1) read the phone numbers out of received sms messages.
2) send an sms message.
3) finally, this one isn't necessary but would be a bonus: cause the phone to vibrate.
From what I can tell this wouldn't be possible on iphone or windows mobile, what other phone types cannont do this?
It will probably not work on iPhone, considering the limitation on all applications in an iPhone. (Apps are in their own little world so to speak)
Vibration: All that supports vibration.
Sounds to me like you should focus on Android, where you will be able to do all of your mentioned things.

Detect type of Display Device (Monitor/Projector) through Silverlight Client

I know that we can find the screen resolution of the client's monitor.
Is it possible to find out whether the type of device is Monitor or Projector?
If I want my web-based silverlight client to work only in Monitors and not on Projectors or vice versa, is it possible to enforce that?
The following SO question deals a similar matter in the case of java applets.
Detect Display Type (Projector) from within the browser
So whats the case with silverlight?
I don't think even Windows knows that. Most of the time it's the display driver and only on laptops. So, I don't know of any easy way of doing that. You could use encrypted DRM to enforce HDCP but even then...no go more than likely. Silverlight is basically VB .net or C# so perhaps try to find an example in those languages.
EDIT: I did some more looking around and found no real API that provided a way to detect an outputs type (Monitor or Projector)

How to set specific IMEI in Nokia S60 SDK emulator

I'm also interested in other Symbian SDKs that allow to set their emulator's IMEI.
Emulator has hardcoded IMEI of '000000000000000'. Replace what with whatever you want to use and continue running your code.
Symbian C++:
TPlpVariantMachineId imei;
PlpVariant::GetMachineIdL(imei);
imei.Copy(_L("123456789012345"));
Python for S60 (PyS60):
import sysinfo
my_imei = sysinfo.imei()
my_imei = u"123456789012345"
My general approach to these kinds of things is do it in software.
Put the IMEI fetching code into one globally-accessible function, and only use this function for IMEI fetching.
#ifdef __WINS__ can be used in C++ code to selectively compile in the hard-coded IMEI you want to return in the emulator. In Java, you can probably tell you are in the emulator by other means (eg if the IMEI returned is a fixed weird value in the emulator), and act accordingly.
You can go one step further and have a dynamic IMEI. Once you do that, you will find that testing your code with different IMEIs becomes much easier.
I have never actually tried that but here's my best guess:
The emulator doesn't have a proper telephony implementation unless:
you link it to an actual phone over infrared/usb/serial. In which case the emulator telephony component will need configuration to use AT commands to pilot the phone (even if the phone isn't a Symbian phone). This allows you to make phone calls, send and receive SMS/MMS but certainly not change the IMEI.
you use the SIMTSY module. This is a component that uses configuration files to simulate telephony events. It can pretend to send SMS/MMS, pretend you are receiving a phone call...none of that actually creates any kind of network traffic, you understand. I assume the IMEI is in the configuration file but I don't expect you can properly change it without restarting the emulator. I have never seen SIMTSY used outside of Symbian itself so I don't know whether it is available to third-party developer. It should be open-sourced with the rest of the operating system within the next 2 years, though.
There is also the possibility that the way the SDK itself was built disabled most of the telephony framework for the emulator, using build-time macro. You should check http://forum.nokia.com

Resources