Why we getting user agent as Dalvik instead of android? - java

On certain Android devices, I receive the user agent as shown below, and on other devices, the user agent is Android. Does this device depend on anything else?
Dalvik/x.x.x (Linux; U; Android x.x.x; <phone model> Build/XXXX

Related

Android Caller ID Device

I have a caller id device as in the image. For Windows, this device works flawlessly. However, I need to get the phone number of the caller in my android application by connecting this device to the android device with otg cable. Does it support Android caller id devices or can I access the caller's phone number by listening to the usb port in my android application?

How to connect android devices to vs code in flutter for check the code?i turned on debugging too

I am stuck here. I connect a USB drive from my laptop to the android device but still vs code shows no device. Image Attached
Considering that you have successfully installed Flutter and Dart and their respective VS Code Plugins.
There are 2 ways to do it
If you have a physical Android Device, you must enable USB debugging on your device and then you can connect it directly to your machine. Once the device is successfully connected and detected by your machine, then its name would appear on bottom right corner in VS Code window.
If you don't have a physical device, then you must create an emulator image of Android platform of your choice. The emulator image must be created from AVD manager present in Android SDK. Once the AVD image is ready and running, the name of the AVD would appear on bottom right corner of VS Code window.
If you see your device name on bottom corner of VS Code, then press F5 and wait for the app to load on the device/emulator.
There are basically two ways before the app is released.
USB Debugging
Wireless Debugging
Connect via USB: adb tcpip 5555
Disconnect USB, Get Phone Ip Address Settings > About Phone > Status.
Now adb connect <Your IP Address>
Refer:
How to connect a device with ADB over WiFi when making app with Flutter?
https://appmaking.com/run-flutter-apps-on-android-device

Programatically establish serverless bluetooth connection with computer

I made an app to turn my phone (LGV20) into a PC keyboard using Android Bluetooth. I'm trying to remove the PC server code by getting my app to pair my phone as a keyboard instead of a phone.
The only app I found that doesn't require a PC setup or rooting is Blek. It seems that when you turn the app on it tries to pair your phone as a keyboard like I want. However, I can't figure out how they did it. I imagine they did something like this:
public class MyBluetoothAdapter extends BluetoothAdapter {
private static final String DEVICE_PAIR_TYPE = "Keyboard"
...
}
That's not a real variable in BluetoothAdapter but I imagine something like this was used.
The hint should be when you looked at the app's description:
The receiver device must have Bluetooth 4.0 ....
So a search shows that among the many GATT specifications:
https://www.bluetooth.com/specifications/gatt
There is a HID over GATT profile
And it appears that each Bluetooth LE chip manufacturer has a keyboard HID over GATT example.
I suspect that each Bluetooth LE chip SDK has some JNI/C level type stuff to enable keyboard HID over GATT.
From this SO post: is there any ble api in Ndk
It looks like lower level Bluetooth access is available but invocation may vary on a chip to chip basis.
Given that Android allows for a number of different chip vendors, the author of the app you cite may have some of such SDK based code installed but may not work on all devices.
One open source(ish) implementation that I've found but not tested is:
https://github.com/kshoji/BLE-HID-Peripheral-for-Android
which appears to have a min SDK of 21. However the 'secret sauce' is still 'hidden' in an AAR in the author's lib directory.
So what else can be done?
Find out what Bluetooth Low Energy chipset your device uses. I don't have access to a LGV20 but perhaps something in the logcat will point to a manufacturer.
Once you know the manufacturer and chipset series, see if you can get access to that chipset makers particular Bluetooth Low Energy SDK for any sample code/modules which can enable HID over GATT.
Write app with such code/module with the understanding that you may need to deal with JNI/C.

Generic linux usb permission rule

I am trying to use Java4USB to gather usb devices info on Raspian. My java app runs under its own user, but has no access to usb devices.
I have seen that adding udev rules can do the trick, but...
How can I allow usb access to all usb devices to my app, without changing access rules for other users ?

How I can get the UUID of an Android device by JNI

I am developing a dynamic library for Android devices by JNI. And I have to get the UUID of the device without using of the Android APIs. I have tried to get the CPU Serial Number or MAC Address via Shell Scrip. such as:
cat /proc/cpuinfo
cat /sys/class/net/wlan0/address
But the Serial Number is always 0000000000000, And there is no wlan0 folder in my phone. Now I am so lost, can anybody give me some tips!

Categories