how to uniquely identify android device after android 13 - java

I wanted to use a unique id using physical address but after android 11 couldn't get that feature allowed in my application.
Is there any other way to identify my app on different devices using unique id.

Related

How to make a bluetooth connection between Android Phone and PC without knowing server UUIDs?

I am making an app to sync my PC and Phone together with bluetooth when they are paired. Since I want to be able to use multiple devices, I want to generate unique UUIDs to identify each phone/computer in the mix. However, according to the Android Doc pages, if I want to connect to a device, I need its UUID. Is there some way to connect hard coding in a UUID? Can I create a server connection just based on the mac address of the device?

How to get uuid of android with Java as some other Cordova app did?

I was inspecting a Cordova app which makes API Call to a free open REST API. In one of the POST Requests, it sends the Device Id in a JSON Object. The Device ID in the Cordova App is obtained using:
this.device.uuid;
I am planning to build the same app using Java and hence need to access that Device Id in order to make the API Call. I tried to do the same using the following code.
TelephonyManager tManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
String uuid = tManager.getDeviceId();
But I realized I will need to access READ_PRIVILEGED_PHONE_STATE in Manifest file but that could only be accessed with System App and not a third party one. So how's this Cordova App accessing it?
P.S. - There are chances that this.device.uuid; of the Cordova App might not be returning what I am thinking. So, I will just show you the device Id of my phone by which you might be able to figure out what this is and how to access it in Android using Java.
Device Id the Cordova app is getting - 29904bc142b60dce (doesn't change)
The code I mentioned above has now been deprecated. Use the following code:
String device_id = Settings.Secure.getString(this.getContentResolver(), Settings.Secure.ANDROID_ID);
Also, After Android M; there is different Device ID for every other app. This is what I couldn't figure out and was beating my head over. The app that I developed had some other Device Id in comparison with the app I was comparing it with. So do not expect two different apps in the same device to have the same Device ID.

How to generate unique channel name for every user in agora.io Java?

I am developing an live video broadcasting app in android java using agora.io services.
Problem is here agora.io provide a specific channel name but I need a unique channel name for a specific user. So question is that how to generate a unique channel name so every user can connect with a specific channel name.
if any one know best option then agora.io for live video broadcasting sdk or api in android java.
Thanks in advance.

Identify Http Request Devices

I am trying to make a spring web application and it will be requested from multiple devices (e.g. Android phones and iPhones). I need to identify the device which sends a request in order to recognize it in a later stage. How am I to achieve that in java?
A sample scenario: User signs in using a Samsung A7 and another user signs in using an iPhone 8.
I need to track and store the actions by the device. I think I need the user of a device to log in every time in order to show all actions executed by this related device. I need to recognize the device for every request here and also I will need to show to the user all logged-in devices.
I have tried to achieve this with a mac address but I think it's not effective.
when type on cmd "ipconfig/all" the following list appear but which physical address should choose between all of them ??!!!!
and i try this java code to get mac address but a NullPointerException is occurred
InetAddress address = InetAddress.getByName(HttpRequestHelper.getRemoteAddress());
NetworkInterface ni = NetworkInterface.getByInetAddress(address);
byte[] mac = ni.getHardwareAddress();
Are you using a native app for mobile or yours is only a website?
Any way the only way is recognize user agents headers to know the device and you can use for example the device token push address that is mostly unique id.
If yours is only a website you can store the device with a generated id or random, save to your database and on browser cookies

Securing endpoints in app engine using Android app

According to this docs when you create the client ids for the endpoints you need a web client id, an android id and the audience parameter set equal to the web client id. Now since in the app you need to use something like that:
String aud = MY_WEB_ID;
GoogleAccountCredential credential = GoogleAccountCredential.usingAudience(context, aud);
I don't understand how the android id is managed because it seems it's never used. I created the android id and in the cloud console I set the package name for the app so the android id is bounded to my app, but it's actually never used, or at least is used in the endpoint but the client never use it. I hope someone can clarify.
The Android ID will be used to identify your app to the backend and not the user itself who will call the endpoint.
The Android ID is related to the certificate which will be used to sign your app. So you will have to create a second Android ID when you want to put your app into the Google Play Store because you will sign your app with the release certificate.
There will be not need to use the Android ID itself in your code.

Categories