I would like to install an APK from within an Android application. Can anyone give me an example of how to do this?
EDIT:
Also how do I open the install applications from unknown resources preference page so that users can change it?
EDIT:
I actually meant open the screen using code, so I can immediately open the preference page for the user to simply check the box, and press back. Is it possible to check to see if they allow non-market apps?
Can an application request permission enough to do this?
use an intent with the link of your apk file.
Intent intent = new Intent(Intent.ACTION_VIEW ,Uri.parse("http://movil.reforma.com/android/Android_Noticias_Reforma.apk"));
startActivity(intent);
install applications from unknown resources preference
go to
Settings > Applications > Unknow
sources
Related
In my project, I need to see the location of my shared preference where can I see it.
SharedPreferences are stored in an XML file in the app data folder, i.e.
/data/data/YOUR_PACKAGE_NAME/shared_prefs/YOUR_PREFS_NAME.xml
or the default preferences at:
/data/data/YOUR_PACKAGE_NAME/shared_prefs/YOUR_PACKAGE_NAME_preferences.xml
SharedPreferences added during runtime are not stored in the Eclipse project.
Note: Accessing /data/data/<package_name> requires superuser privileges
Go to device File explorer at the right bottom of your android studio. From there go to data-> data->(your package)->shared preferences
I can't figure out where to upload mapping.txt in the new Google Play Console.
To upload a deobfuscation:
Open the Play Console.
Select an app.
On the left menu, select Release > App bundle explorer.
Select the Downloads tab, and scroll down to the 'Assets' section. Click the upload arrow for the mapping file or the debug symbols as applicable to upload the deobfuscation for the version of your app.
You can also get details on here
It's under a bundle options menu:
You can upload mapping.txt in Google Play Console New UI in this way
Select Release > Production > Upload ReTrace mapping file
I suggest you use aab format, it will save you the hustle to do it manually.
i am using eclipse for android programing and now i need to view SQLite database in the emulator.
I followed these step:
Download .jar file
Place the plugin .jar file in your Eclipse plugins folder (e.g. /usr/lib/eclipse/plugins)
Restart Eclipse
Start up an Android Emulator w/ Debugging in Eclipse
Switch to the DDMS Perspective in Eclipse
Go to the 'File Explorer' tab to locate your device's database file
Navigate to: e.g. 'data -> data -> com.myproject -> databases -> myproject
Now when i try to Open the database file in Questoid i can't select it!
(see screen shot)
same advice?
From your screen shot there, the database does not have a "." (read: period) in the file name & extension area.
Improper: mydatabaseDB
Proper: mydatabase.db
Once the database shows the proper extension (and is a proper SQLite database), then Questoid will (I use the plugin all the time in Eclipse (Juno version)) then show the "active" button (not disabled like in your screen shot). When looking for latest database entries (what was just added into the database), I then click once again on the toolbar icon as you show there, in the upper right of the screen. I then go to the Browse Data tab for that view, then choose the table from the database I want to view the fields from.
I hope this helps.
Happy coding...
I had the same problem with "sqlitemanager": only .db-Database files are accepted.
This is the solution:
Download this Questoid SqLiteBrowser: http://www.java2s.com/Code/JarDownload/com.questoid/com.questoid.sqlitebrowser_1.2.0.jar.zip
Unzip and put it into eclipse/dropins (not Plugins)
Try following these steps:
1) Close Eclipe
2) Remove the .jar from /usr/lib/eclipse/plugins.
3) Place the .jar in /eclipse/dropins and let Eclipse try to install it for you.
4) Start Eclipse.
you can always use sqlitebrowser externally . You will have to pull your databse everytime from ddms though .
The file has to end with .db extension, so the answer is to name your database as this sqlite browser expects it to be.
Another way of fixing it is to find a year old version that does not have this constraint.
Please use the extension ".db" in lowercase, please don't try with these extensions .SLQLITE, .BD, .DB, .SQL, or similar or without extensions.
Regards,
I know I can install an Android application programmatically by the below code which passes the URI of an APK file. Can I install the application without passing an APK file URI? For example, getting the byte array of an APK file and installing it?
File appFile = new File("application.apk");
Intent installIntent = new Intent(Intent.ACTION_VIEW);
installIntent.setDataAndType(Uri.fromFile(appFile),"application/vnd.android.package-archive");
startActivity(installIntent);
When you install an application this way, you aren't actually directly installing the application. What happens is that you start the installer and pass the installer a reference to the APK that you want to have installed. The installer isn't part of your application code and has no access to the memory in your application's process.
The only way to do this, if you have a byte array containing the APK, would be to write the byte array to a file and then start the installer and pass it a URI that points to the file that you've written. Once the installation is complete you could then delete the file (so as not to leave random garbage on the user's phone).
Every time I click a Java Webstart button, Firefox downloads the JNLP file and puts it in my Downloads folder. I have over 500 JNLP files from my JWS app called name-123.jnlp and so on. Internet Explorer doesn't do this, is there a way to stop Firefox from doing it ? I'm the app's developer, so server side changes are possible too.
Additional info: I set the mime type correctly on the server.
You can try following
In your Firefox browser, go to Edit >> Preferences >> Applications, in Content Type select the option "use other" for jnlp files
2.In the dialog box, select the "javaws" file location (for me, it was located in "/usr/java/jre1.6.0_16/bin")
I have it working on Ubuntu