I am trying to develop an application for android for the DJI Mavic Air where I want to use the mapwidget. When I run the app it crashes and I get the following error:
Error trace
The error seems to happen when I call the initGoogleMap. I have called the mapwidget functions onCreate(Bundle), onResume(), onPause(), onDestroy(), onSaveInstanceState(Bundle) and onLowMemory() in the corresponding methods in my app.
Does anyone know what the problem could be?
Change your Google Maps API version 9.4.0 or earlier to avoid this crash. In later API versions, MapView.onStart() was added to the Google Maps API and creates a conflict with an internal method in the DJI UX SDK.
Related
I am new to Android Development and I am learning Maps SDK for Android.
My API key for Maps SDK is working fine and I am able to see Map on my screen with a marker.
But the problem is, I am not able to use the Place Autocomplete service and facing the following two errors:
APIException code 9011
APIException code 9010
Here my Places SDK is not working though I have enabled it while creating API Key. I have searched about these two errors but yet I am unable to find the reason for the above-mentioned errors. Sorry for using bad English, please tell me the reason why it's happening with me.
These are the errors you are getting:
https://developers.google.com/places/android-sdk/reference/com/google/android/libraries/places/api/net/PlacesStatusCodes#public-static-final-int-over_query_limit
and
https://developers.google.com/places/android-sdk/reference/com/google/android/libraries/places/api/net/PlacesStatusCodes#public-static-final-int-request_denied
Make sure you are using the newest Places SDK client and that you are have enabled the Places API.
https://developers.google.com/places/android-sdk/client-migration
You can check these above mentioned APIException codes at link. After that Ensure that your Places SDK is turned on. But places SDK will only work if you have attached your credit card to the Google Maps account. that's all.
I would like to write an application which can programatically generate touch events on the phone.
I have already tried this methods:
adb : adb swipe and so on... It requires USB cable and connect the phone to pc
adb ON TCPIP: same
My problem with adb is to require so much presetting by user and I don't want to make the user to learn it. I have already made an application which use adb, but it's difficult for the user to set up properly :(
I have heard and I tried to sign my application with platform sign, but it's not good for me, because I would like to publish my app on android market and it is not a system application...
I would like to find a way to achieve this in a single application which can produce touch outside of the app (from background) and I would like to publish on market.
I have found this application: https://play.google.com/store/apps/details?id=com.teamviewer.quicksupport.samsung which can basically do this. Because when I click on my computer, it send a message to the phone and the phone make the touch on the screen. How and with what privileges can teamviewer do it?
Please give me some advice about it.
I would like to find a way to achieve this in a single application which can produce touch outside of the app (from background) and I would like to publish on market.
This is not possible, outside of what little input faking can be done by an accessibility service.
How and with what privileges can teamviewer do it?
If your read that Play Store listing, you will notice that it only works with Samsung devices. That is because the makers of TeamViewer struck a deal with Samsung to enable this sort of integration. Similarly, the TeamViewer team struck deals with a few other device manufacturers. However, they did not do so with all manufacturers, and so TeamViewer does not work on all devices.
Have a look here .This might be useful.
InputInjector
Android library that eases the process of injecting InputEvents (MotionEvent, KeyEvent) to you Android app. The library uses internal API calls to inject events and depend on the accessability of these. This library will therefore not work on all devices but theoretically support Android 2.3 and forward (API level 9-18+).
Androd 2.3 (API level 9-15)
In older versions of Android we envoke the same system calls as used by the Instrumentation framework.
Permission No special permission needs to be set.
Androd 4.1.2 (API level 16 and forward)
As of API level 16 we have access to the InputManager class. We use this as the basis for the input injection.
Permission Using InputManager for injection requires setting permission android.permission.INJECT_EVENTS in your manifest.
Using this permission may require altering Lint Error Checking in order to be able to compile. In Eclipse this is done by going to Window->Preferences->Android->Lint Error Checking and then finding ProtectedPermissions and setting severity to something else than error.
NOTE: In order to inject events to other apps using InputManager, your apk must be signed with system level certificate.
https://github.com/arnebp/android-inputinjector
I'm trying to develop an Android app that has a native Google Maps control. Seems simple enough, but unfortunately I've run into a lot of trouble setting it up.
I have very carefully followed the instructions here multiple times with no success. Every time I try to load up my app, I get the message <my app> won't run without Google Play services, which are not supported by your device. I have confirmed in the settings that I do in fact have Google Play services on the device.
I have tried to uninstall and reinstall downloaded google services apk's, but abd does not allow me to uninstall it with the error DELETE_FAILED_INTERNAL_ERROR, I assume it is because I don't have root access.
You need to update your SDK and install the latest Google Play Services library under "Extras" section. The AVD can be launched using "android" binary under your SDK tools folder.
So I found the answer to my own question. I made a dumb mistake...
In my manifest, I entered my api key where it says API_KEY: android:name="com.google.android.geo.API_KEY but it should just be API_KEY. Changing this, and using Google Play services 9 instead of 10 fixed it.
I was wondering if it was possible to make an android app (that does not require root) that could enable and disable the use of mobile data for other apps? I know there's a function to toggle background services per app inside the native Android settings, so maybe there's some public methods for me to do so with my own app.
Basically, I want my app to control whether other apps could access data via mobile data or WiFi only.
Pointing me to the right direction would be greatly appreciated as well.
Theoretically, yes.
See: https://github.com/android/platform_frameworks_base/blob/dbc51de44fe4f9a7f81528204250de32ec405d39/cmds/svc/src/com/android/commands/svc/DataCommand.java
This is the svc tool that can be launched via adb shell. It did error out with code 137 for me (unrooted Nexus 5), though. But from the code you see how this should theoretically work.
You retrieve the TelephonyManager and enableDataConnectivity, which is, of course, a hidden API (see: https://github.com/android/platform_frameworks_base/blob/6b8a3a52acf1c2722551f1ea1ce47831f87939cd/telephony/java/com/android/internal/telephony/ITelephony.aidl). Accessing hidden APIs is possible by recompiling the android.jar that you build against, or by using reflection (see: How do I build the Android SDK with hidden and internal APIs available?).
Hope this helps.
I have written an app that appears to work faultlessly on android 2.3. I have just been told by email that my app crashes (immediately on startup) on android 3.0 tablets. Unfortunately I do not have access to such a device.
To try and make my app as crashproof as possible I have been employing Lint and FindBugs. My program does use more than one thread and Findbug reports several instance of "Inconsistent synchronization" because different threads may be reading certain data at the same time. I beleive this not to be a problem because at the times the data is being read it should not be in the process of being altered. It occurs to me though that perhaps android 3.0 has some built-in detection of such instances?
I am interested in any other thoughts on what kind of things would cause a program to work on 2.3 but not on 3.0.
I had a similar problem with an app.
My issue was due to the introduction of a new exception when I attempt to perform a networking operation on the main UI thread.
Please refer to How to fix android.os.NetworkOnMainThreadException? to have more explanation.
I also used the Android emulator with the Android 3.0 API to reproduce the bug.