Google Map update with WiFi but not with 3G - android

I've made an app that determines the location (balloon) and shows it on Google Maps (with roads, city etc) so an active internet is needed.
This works fine when I'm using WiFi but not on 3G. It determines the location and the location-output tot Google Maps is allright (including a balloon) but the Maps (with road, rivers, city etc) will not update.
Hereby my manifest-settings:
<uses-library android:name="com.google.android.maps" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.CONTROL_LOCATION_UPDATES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

I solved the problem myself but here's how:
After reading several articles on the net it seems some kind of api key error.
I read there's a difference in debug-key and signed key so I replaced the debug key with the signed api key and that did the trick.
Why wifi worked and 3G not it's not clear te me and really I don't mind because it all works fine now

Related

In android Manifest how do you declare that a permission is not required?

Say I have these permissions:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission
android:name="android.permission.PACKAGE_USAGE_STATS"
tools:ignore="ProtectedPermissions" />
I would like to tell the Play Store that these permissions are not required and are not to be used for filtering out devices. I found that with some permissions like bluetooth you can add the <uses-feature tag and then to that add android:required="false". For example:
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<!-- Tells the Play Store that the above two permissions are not required -->
<uses-feature
android:name="android.hardware.bluetooth"
android:required="false" />
However I found no features to declare for any of the permissions I listed in the beginning of this post. So how am I supposed to tell the Play Store that they're not required?
So how am I supposed to tell the Play Store that they're not required?
You don't. No devices will be filtered out based on those permissions.
I would like to tell the Play Store that these permissions are not required and are not to be used for filtering out devices
No permissions are used directly for filtering out devices. As you noted, some permissions imply features, and you can declare that the features are not required.
I would like to tell the Play Store that these permissions are not
required and are not to be used for filtering out devices.
Don't worry! If your next update/package don't require some permissions, just remove those permissions from the mainfest.xml, and done. If you still have doubt, you can see the number of compitable device models during creation of release in your console.
I found that with some permissions like bluetooth you can add the
<uses-feature tag and then to that add android:required="false".
They are all for feature-based filtering and not for permissions. Because, features might be critical for some apps to work. If an app uses a feature which is not critical for its functionality, required=false might be helpful.
You can use like that:
<uses-permission android:name="android.permission.INTERNET"
tools:node="remove"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"
tools:node="remove"/>

Any idea why/where my Android app would request access to photos when the device is set to French?

When my Android app is installed on a device set to French, it request access to photos and contacts. The main app does not need or request these. Is there somewhere that I need to change a setting to not request for any language?
Manifest permissions:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />

why android.hardware.telephony feature is being added automatically in android app

While releasing the apk to play store, I found out that the my app requires the android.hardware.telephony feature but I haven't added it in manifest anywhere. I have also check the merged manifest in android studio and it also does not contain this feature so I think no third party sdk is adding this. What could be the source of this feature?
For reference, I have following permissions declared in the manifest:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_SMS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
Also, when I make it optional using below code, the app is available on devices without this feature:
<uses-feature
android:name="android.hardware.telephony"
android:required="false" />
So why is required by default without adding it anywhere?
Google Play automatically adds some features, depending on which permissions you have requested.
As you have requested READ_SMS and RECEIVE_SMS permissions, this implies you use the telephony feature. So, Google Play reacts as if you had the following in your AndroidManifest.xml:
<uses-feature
android:name="android.hardware.telephony"
android:required="true" />
When you manually add this and declare it required="false", this tells Google Play that whilst you do ask for the permission, you can handle the case where the user does not have the telephony feature.
This is confirmed via this note in the docs:
Note: Some system permissions implicitly require the availability of a device feature. For example, if your app requests permission to access to BLUETOOTH, this implicitly requires the FEATURE_BLUETOOTH device feature.
The full list of permissions and the feature requirements implied is available here, and includes your situation:
Finally, with your ACCESS_COARSE_LOCATION you are also declaring a feature requirement on android.hardware.location, just for your information.
There's also further detailed information over on the GameDev StackExchange.
One or more of the dependencies / modules / libraries your project is using is adding that requirement to your Android Manifest.
To investigate open your main Android Manifest file in Android Studio, and click on the Merged Manifest tab at the bottom of the page.
This will show you a view of the final merged Manifest, along with sources of each line.
Read more about this here: https://developer.android.com/studio/build/manifest-merge#inspect_the_merged_manifest_and_find_conflicts
HOW TO FIX
If you wish to avoid adding that requirement to your final Manifest, you can use Node Markers in your Manifest to control how the merge works.
Read more about Node markers here: https://developer.android.com/studio/build/manifest-merge#node_markers
e.g. try this:
<uses-feature
android:name="android.hardware.telephony"
android:required="false"
tools:node="replace" />

LocationClient requirements in manifest file

Okay I'm using LocationClient API but without viewing Maps in my application. All I'm doing is updating current locations to the server. Of course the last 6 hours locations.
1)Should the following permission be there?
<permission
android:name="com.example.myapp.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
2)should the API key still be there?
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyCxXOFev03HX4vr6ZGfd0983noouy3wt0g" />
3)Should I use this permission as well?
<uses-permission android:name="com.example.myapp.permission.MAPS_RECEIVE" />
No, you don't need those permissions if you aren't using maps. You only need location permissions:
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
or
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

GoogleMap V2 loads map randomly android

I have implemented Google Map V2 in my application, Everything works just fine.
Checked on 2-3 mobiles and tabs it runs perfectly,
But it runs for 10 to 15 times a day on single device.,after that it does not load map on same device and gives following error.
05-06 07:17:41.866: E/Google Maps Android API(17217): Failed to load map. Could not contact Google servers.
In short, sometimes it displays map and sometimes it does not.
I m using map key generated from android debug key.
Please suggest some solutions for this.
My Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ocatalog.mapdemo"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<permission
android:name="com.ocatalog.mapdemo.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.ocatalog.mapdemo.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyA9E-oCIM2d5rlhxnsJf66Bly57JXpkiKI" />
<activity
android:name="com.ocatalog.mapdemo.MapDemoActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I am experiencing the same problem, the maps are running OK on multiple devices, but randomly show a blank screen, sometimes for days.
When I debug the code I can see that all actions like adding markers, overlays, etc. are executed properly.
Also, no idea if this is related, but the Geocoder seems to be working correctly in the meanwhile, so it is definitely not related to an Google Services connectivity issue(or is it?).
Besides, the map also works fine offline and the cache data is stored properly (well, most of the time that is).
Clearing my app's cache and data also doesn't help. Nor does doing so for the Google Services app.
However, reinstalling the application seems to fix it for most of the time, but does not prevent it from reoccurring.
Add the following permission in your manifest file
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
There are Google Maps API v2 and Google Maps Android API v2.
You should use Google Maps Android API v2.

Categories

Resources