I'm programming an Android application, and I would like to do so that it doesn't shut down the screen, ever.Pretty much like a car gps app that keeps the screen on.
Would someone know how to do this with phonegap ?
If its not possible in Javascript, is there an easy way to do it in Java but inside the main Phonegap function ?
Thank you
use this property in the ManiFestFile
<uses-permission android:name="android.permission.WAKE_LOCK"/>
and add this in the required Activity
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
Related
Is it possible to write a function to clear the app cache on my app. I know that I can go to app settings and clear it that way but I want to be able to do that within my own app in code when its finished processing.
Any suggestions would be greatly appreciated.
I have tried Clear Cache in Android Application programmatically but the app still shows that the cache is not cleared.
I have also looked at How to delete app cache for all apps in Android M? but have not been able to write something to do this.
I have added <permission android:name="android.permission.CLEAR_APP_CACHE"/>to the manifest but this does not seem to make any difference.
I found some launchers that are able to run installed apps inside their own activity. ( https://play.google.com/store/apps/details?id=com.lwi.android.flapps )
This launcher adds their own functions like maximize, minimize etc. I guess they are creating widgets (because they need drawing over apps permission) and running inside them. But how :)
Can you show me how I can run another android application inside my own activity, widget etc. like this app did ?
Best,
Kerg
I think the following documentation should help you out with learning how to get your app to interact with other apps: https://developer.android.com/training/basics/intents
Especially interesting to you would be the section on sending the user to another app: https://developer.android.com/training/basics/intents/sending
I have developed an android app. All the things are working fine but the main problem is, using the Hack App Data anyone can see the ad codes which is a very dangerous threat.
Now how can i prevent hack app to open my application or edit my application data or how can i prevent hack app data to access this sensitive information?
note: I have turned off android:exported="false" and also add <permission android:protectionLevel="signature"
android:name="apricot.com.newshunt"/> to my menifest file
you can set the Copy Protection to On in the Android Market upload page. It's near the bottom. I doubt it is fool-proof but it can help keep some of the people likely to do this from being able to.
You should add the view in Java instead of XML and obfuscate your code.
I have an Android app which is basically a Player. My users sometimes uses my app with a connected Bluetooth device like Speaker, Headphone, Car etc.
I have no special code to use or manage Bluetooth. But since Android OS managing it, my users able to use Bluetooth devices without any development from my side.
Lately i got some feedback that my app not playing well on Bluetooth devices and sound freezing or flickering. And they are saying they have no problems with other apps like Spotify, Youtube etc. Also i could not find any issue in my tests.
So any idea what problem can be? Is there anything i can implement to prevent it. Is there any way that i can reproduce that problem?
I don't know it will fix the issue. But for a try, can you please provide the following permission in your app's AndroidManifest.xml
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
I'm trying to turn airplanemode on on Android but I got the following message:
java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.AIRPLANE_MODE
From my point of view (and some researches):
(1) I'm using all necessary permission to do that:
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
(2) The code is not wrong:
Settings.Global.putInt(
context.getContentResolver(),
Settings.Global.AIRPLANE_MODE_ON, 1);
Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
intent.putExtra("state", true);
context.sendBroadcast(intent);
I know that the app needs to be installed as a system app, so I'm installing that under /system/app/my-app/ (I tried /system/priv-app/my-app/ too) and added all the permissions to the folder and to the apk.
The last thing that I tried was the include of android:sharedUserId="android.uid.system" at the AndroidManifest.xml, but doing that the application disappears.
What am I missing here, after all those attempts?
ps: The device is rooted.
Thanks in advance
It seems although Airplane Mode has become a Constant value as of API Level 17 as per the Android development documentation.
Why are you turning airplane mode on? Is there a certain functionality you are trying to accomplish?
I would've posted this in the comments, but I don't have enough rep... tfw