How to get imei number, mac address(or uid) of mobile device on adf mobile - oracle-adf-mobile

I need to get imei number and mac address of device (supposed to be works on both android and iphone) on adf mobile. Actually, even if i could get the device uid(unique identifier key) can be useful for me. Any comments about uid for 2 platforms that valid are welcome
bgrds

// Device ID ;
android_id = Secure.getString(ctx.getContentResolver(),Secure.ANDROID_ID);
// Device IMEI ;
TelephonyManager tm = (TelephonyManager) ctx
.getSystemService(Context.TELEPHONY_SERVICE);
String Imei = tm.getDeviceId();

webyildirim, As per my knowledge you need to get the device os name, then based on OS condition you achieve the IMEI number, already posted for andriod, this one for Ios. thanks
NSString *ImeiNum = [[NetworkController sharedInstance] IMEI];

Related

How to take Usb slot in the hub immediately after plugging it in?

I am implementing a scenario where I should take the slot of a Usb immediately after I plug it in. 15 is what I want to take.
The code works fine after plugging in the 1st Usb. When I plug the 2nd Usb earlier than 1 minute after the 1st was plugged, I do not get any information for the 2nd Usb which is already plugged in. I will show you the code which handles the retrieve of the slot information. This method is executed after a fired event when a USB is plugged in.
Main thing: I have to wait more than 1 minute, then I can plug the 2nd Usb and take the slot. If I plug it in before waiting 1 minute after the 1st is plugged I do not take any information for the last Usb plugged.
static int GetPhysicalPort()
{
try
{
devices = new List<USBDeviceInfo>();
ManagementObjectCollection collection;
using (var searcher = new ManagementObjectSearcher(#"Select * From Win32_PnPSignedDriver WHERE DeviceId LIKE 'USB\\VID%' AND Description = 'USB Mass Storage Device' "))
{
collection = searcher.Get();
searcher.Dispose();
}
foreach (var device in collection)
{
devices.Add(new USBDeviceInfo(
(string)device.GetPropertyValue("DeviceId"),
(string)device.GetPropertyValue("Description"),
(string)device.GetPropertyValue("Location")
));
}
collection.Dispose();
string LastAdded = devices[0].Location.Substring(6, 4);
Console.WriteLine(LastAdded);
return Convert.ToInt32(LastAdded);
}
catch (Exception e)
{
Console.WriteLine(e);
return 0;
}
As per WMI Win32_PnPSignedDriver class it would be the application which would be taking that much time to query or give results for the USB inserted second time. This depends on application to application as the pole rate or response rate of that application running this WMI query would be designed it such a way to give results in 1-2 min.
We could check the same in terms of OS level or WMI level to see if WMI as a whole is taking time to give query results on the machine.
Open Run command and type WBEMTEST.
Click on connect as it will connect the CIMV2 Namespace. Under this namespace lies the class Win32_PnPSignedDriver
As an when we query this class with the query select * from win32_PnPSignedDriver it would shows us some results instantly like for eg 60-70.
Now when you close it and again run he same query it would show some more or the same results depending on the OS etc.
The above will show us that WMI query or WMI as a whole is working the way it should be on the machine.
The issue could be caused by the application which is taking this much time to read the contents of the second USB as per the WMI query it is querying.

How can I calculate the signal strength of my wifi and 3g using android SDK?

I try to make an application that will calculate the signal strenth of my wifi, or 3g and let the user know about his distance from that access point.
For instance, I have here a sample of my code that will calculate the distance, in kilometers, between device and a wifi access point:
public double calculateDistance(double signalLevelInDb, double freqInMHz)
{
double exp = (27.55 - (20 * Math.log10(freqInMHz)) + Math.abs(signalLevelInDb)) / 20.0;
return Math.pow(10.0, exp);
}
but, when i call the function in android studio, I don't know how to calculate the signalLevelInDb (=dbm) and freqInMhz (=mHz) so I can send them to the function to display my distance. How can I make android studio give me these 2 values? Can I use the same function for the 3g and how?
Please find this information in the offical documentation of the Android SDK:
Android SDK API documentation, SignalStrength.
With this class you have the methods
int getCdmaDbm()
Get the CDMA RSSI value in dBm
or:
int getEvdoDbm()
Get the EVDO RSSI value in dBm
As an alternative you could have a look at the TelephonyManager class which is supported since API level 1. With this at your side you can find out in which network state (public int getNetworkType ()) your mobile device is at the moment (2G, 3G,...) and thus find out or at least translate to a corresponding "frequency".
Hope this helps you for your distance calculation.

What is the "interfaceId" referring to in chrome.usb.findDevices() and chrome.usb.requestAccess()?

I'm trying to get a USB device to work on ChromeOS, and I'm running into an issue. From what I understand, I need to do this for the device I'm trying to utilize:
chrome.usb.requestAccess(Device device, integer interfaceId, function callback)
or, I can use:
chrome.usb.findDevices(Device device, function callback)
Whichever one I choose, I need to provide the interfaceId (as part of the device tuple in findDevices, or as the second parameter in requestAccess)
https://developer.chrome.com/apps/usb#method-findDevices
vendorId
productId
interfaceId (The interface id to request access against. Only available on ChromeOS. It has no effect on other platforms.)
I cannot find any documentation regarding this anywhere -- and nothing I try seems to work.
I was confused too and then I found the answer in the specifications of the function:
integer (optional) interfaceId
Since Chrome 29. The interface ID to request access to. Only available on Chrome OS. It has no effect on other platforms.
Referred to: https://developer.chrome.com/apps/usb#method-findDevices

What user inputs are required for a Digital TV Device Selection?

In the process of building a Digital TV graph, I need:
Network Provider -> Tuner -> Capture -> MPEG2-Demux -> MPEG2 TIF
-> MPEG2 Sections
-> Video Decoder -> VMR9
-> Audio Decoder -> DirectSound
It's obvious to me that I can hard-code in the name of the provider (Microsoft Network Provider), but do I need to prompt the user to select both a tuner and a capture device from the list of available devices, or can I somehow query for the tuner that corresponds to the capture device that the user has selected?
Basically I'm asking whether an API call exists similar to:
IMoniker *pTuner = GetTunerForCaptureDevice(pIMonikerSelectedCaptureDevice);
or whether it's standard to make the user choose both the tuner and the capture devices in their config.
The way that it seems that most applications deal with this problem is to go in the reverse direction. For the purposes of configuration, they provide list of all devices in the category KSCATEGORY_BDA_NETWORK_TUNER and allow the user to select one of the tuners.
After that device has been added to the graph, all devices are enumerated for the category of KSCATEGORY_BDA_RECEIVER_COMPONENT. For each item returned, the capture device item is added to the graph, and connect is called between the tuner output pin and capture input pin. Rough code: (without the necessary Releases()'s)
for (fFound=FALSE; !fFound; )
{
IMoniker *pIMoniker;
IBaseFilter *ppIBaseFilter;
hr = pIEnumMoniker->Next(1, &pIMoniker, NULL);
if (hr!=S_OK)
break;
hr = pIMoniker->BindToObject(NULL, NULL, __uuidof(IBaseFilter),
(void **)&ppIBaseFilter);
hr = m_pIGraphBuilder->AddFilter(*ppIBaseFilter, L"Capture filter");
hr = ConnectFilters(m_pIGraphBuilder, pITunerFilter, ppIBaseFilter)));
if (hr != S_OK)
{
m_pIGraphBuilder->RemoveFilter(ppIBaseFilter);
goto NextMoniker;
}
fFound = TRUE;
NextMoniker:
// release things here.
}
If any of the capture devices successfully connect pins, then the loop ends and that capture filter is used in the graph.
I went this direction of starting with a user selection of a tuner because I was seeing several products that returned more than one tuner device, and when attempting connections in the reverse order (capture, then tuner), I seemed to always be successfully connecting the wrong tuner.

device types in CreateAsyncFind function of UPnP

Please tell me what is range of values I can give in device type parameter of CreateAsyncFind() function. How it detects the devices basis on string given ???
Thanks in Advance !!!
Each UPnP device has its own unique type and URI, you will need to supply the URI in your call to CreateAsyncFind(). As an example to search for a MediaServer:3 device you would use urn:schemas-upnp-org:device:MediaServer:3.
Checkout Device Categories for a list of different device categories.

Resources