can't place call from webpage in android app - android

I have an app that points the user to a webpage with a phone number in it. But when trying to call from the phone number I get an error message.
For the Android manifest, I tried to request phone permissions with both
<uses-permission android:name="android.permission.CALL_PHONE" />
and
<uses-feature android:name="android.hardware.telephony" android:required="false"></uses-feature>
Neither work.
The error message I get is The web page at tel:(the phone number) might be temporarily down or it may have moved permanently to a new web address.
So what am I missing here?

Ensure that the html link for the phone number is something along the lines of:
Call us now!

Related

App getting network issue on latest android real device

In my app I am asking user to access below permission on runtime
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_CONTACTS"/>
at my Activity file I used Easypermission library to enable runtime permission
My app shows user current location after launch. Getting user permission fetch user contact list and then store into firebase database. see device1 pic
Note : Device1 android version : 5.1.1
But fetching problem on another device. where application not getting internet. show as device2 below pic
Note : Device2 android version is 9. Except this app all are working fine on device2
I don't get any clue where is the problem. both device are connected on same wifi.
code is fine except you are fetching location and move camera to current location if internet is connected. see your condition :
if(Connectivity.isConnected(this)) { }
if device doesn't have internet connection it will not proceed inside loop.

Cordova Android app and user permissions

I have an Android Cordova app and I'm using GPS, check the network state, read/write on the Documents folder and taking camera pictures. Here my permissions on the manifest XML file:
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature android:name="android.hardware.location.gps" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
The manifest file is auto generated by the Cordova framework. For some reason I don't see camera permissions. Permissions are not asked at installation time anymore (that's since Android 6) but instead they should be asked before usage.
I correctly get the GPS access permission popup but not the read/write Documents folder permission. I also never get the camera permission albeit I'm able to use it without ever being asked for permission. Same story for the Network status permissions (never being asked).
I find Android permissions scheme extremely confusing, under application manager my app has got Location and Storage as expected, Camera and Network status are missing though.
To recap, inside the app, on the actual code, I'm using at least once those devices
GPS fine grained
GPS coarse (probably the Wifi SSID triangulation trick)
Write on Documents
Read on Documents
Read network status (Offline / Wifi / 3G etc..)
Take picture from the camera
Cordova framework wrote this manifest file:
android.permission.ACCESS_COARSE_LOCATION
android.permission.ACCESS_FINE_LOCATION
android.hardware.location.gps (why is it not a .permission?)
android.permission.ACCESS_NETWORK_STATE
android.permission.WRITE_EXTERNAL_STORAGE
On application manager I get those options:
Location
Storage
So basically I get three different sets of permissions :-(
I found this in the this cordova plugin that you mentioned in comments.
So somehow this <uses-permission android:name="android.permission.CAMERA/> have to be in your code so as this plugin can use it.
Maybe you didn't check the right program to see its permissions, or if the camera permission is not shown in application permissions on device, you can't be able to use camera in this application. Please do a check again because I really want to know what is the situation.

How to read from Bluetooth barcode scanner hardware device

I've been trying to get a piece of code to connect to a bluetooth bardcode reader I bought and have tried almost every library in Android Arsenal.
Currently, I am using this one: https://github.com/MacroYau/Blue2Serial
I have all permissions in my manifest:
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH_PRIVILEGED" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
I also request permission when the app opens:
ActivityCompat.requestPermissions(this,
new String[]{android.Manifest.permission.BLUETOOTH,
android.Manifest.permission.BLUETOOTH_ADMIN,
android.Manifest.permission.BLUETOOTH_PRIVILEGED,
Manifest.permission.ACCESS_COARSE_LOCATION},
0);
I am able to connect to the scanner device from the app, it pairs up ok. But, when I scan something, I don't see the public void onBluetoothSerialRead(String message) method firing up. It was exactly the very same with all the other libraries I tried. I could pair up, but not read it.
Conversely, if I open a notepad type of app in the same phone and scan it, the contents are immediately written to the notepad.
The scanner device I am using is this one: https://www.zebra.com/us/en/products/scanners/companion-scanners/cs4070.html
Anyone with some tip to give me?
Thank you!
I can think of a few things.
(1) You are reading a 'poorly designed' 2D barcode. Some of the older 'standard' barcodes have simple checksums so lots of random data using a laser based scanner can actually result in a decoded value. If I recall correctly Interleaved 2 of 5 was one of those.
(2) If you enabled 'read all barcodes' its possible that the sub-sequence of codeword (white and black spaces) maps to a valid barcode definition. I would only enable those 2D barcode types that you would be be actually reading.
(3) On the Android side your Bluetooth serial reader isn't picking up the data fast enough. This can be mitigated with the scanner sending prefix/suffix values so that the app knows if you don't get those it was a transmission error.

SMS sending permission on Active Android device

I'm a newbie with android development. So far I have developed an application which uses SMSManager.
I'm testing my application on an active device when it reaches smsManager.sendTextMessage it throws exception of android.premission.SEND_SMS.
I know that I have to get device permission.
My Question is:
Can I send SMS while uploading application right from IDE, or have to install .apk manually?
You must add the following permissions in your Manifest file:
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
If you install the application via debugging/IDE/ADB it will automatically get the permissions you require in your manifest.
So: Yes! When run on the device through the debugger, the application will be able to send test messages.
Bonus information: If you do "stuff" that the application doesn't have the proper permissions for, the debugger will give you exceptions and hints to what is wrong.

getting udid of android emulator

I want to get udid of android emulator..How can i get it.Has anyone implemented it before?
Usually you can use TelephonyManager.getDeviceId() to get udid of a device, but if you are using Android emulator, it will return null. Docs here
Update:
You need to require READ_PHONE_STATE permission in your AndroidManifest.xml, i.e., by adding following line in the file:
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

Categories

Resources