Application Installation in Android - android

I needed to know that when my a application installs in a device in android, which component of application framework decides its installation site and how i can manages its installation site (mobile memory or SD card)?

you can provide option for your installation on your SD card.You will need this in your manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation=["auto" | "internalOnly" | "preferExternal"
You can choose among these.
But by default your app will always be saved on device.The user can always transfer it to SD card .

check the android documentation here[1]. To install to SD Card put
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="preferExternal">
in your manifest.
For backwards compatibility use "auto" instead of "preferExternal".
[1] http://developer.android.com/guide/appendix/install-location.html

In your Manifest file, it is set as default so when the user downloads the application, it is downloading into their mobile memory. If you want the user to have to option of moving the application to their SD card, you can add:
android:installLocation="auto"
It should be placed into the manifest section. For example:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.application"
android:installLocation="auto"
android:versionCode="1"
android:versionName="1.0" >

Related

Get permission by default in AOSP project

I'm building a custom OS with my app as system app. I need to get storage, camera, etc., permissions by default when the OS is installed.
How can I get these permission by default without any user interaction?
create a xml file and Add the following lines (name the file as def_permission.xml)
<?xml version="1.0" encoding="utf-8"?>
<exceptions>
<exception package="com.<package_name>.<package>">
<!-- <yourpackage> -->
<permission name="android.permission.WRITE_EXTERNAL_STORAGE" fixed="false"/>
<permission name="android.permission.READ_EXTERNAL_STORAGE" fixed="false"/>
<permission name="android.permission.ACCESS_FINE_LOCATION" fixed="false" />
<permission name="android.permission.ACCESS_COARSE_LOCATION" fixed="false" />
<permission name="android.permission.CAMERA" fixed="false"/>
<permission name="android.permission.WRITE_CONTACTS" fixed="false" />
<permission name="android.permission.READ_CONTACTS" fixed="false"/>
<permission name="android.permission.READ_PHONE_STATE" fixed="false"/>
</exception>
</exceptions>
for Android 9 and above --
copy def_permission.xml to device/make/model/def_permission.xml
add these following lines in device-model.mk , aosp_model.mk
PRODUCT_COPY_FILES += device/make/model/def_permission.xml:product/etc/default-permissions/def_permission.xml
and build your custom rom , this will enable permissions for your apk by default

Android/data/package------my package name is missing

Android 4.4;
when my apk is installed.
there is no my package in Android/data/com.example.helloworld on mysdcard even the inner mem card
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.helloworld"
android:installLocation="preferExternal"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
there is some other package there,"com.android.browser" .etc
i try to delete the browser's folder,when i run the browser or restart the mobile the package appear again
but there is no package_name of mine,no where to find,but the app runs normal
on 4.4 we cant mkdirs there,only under the package name(but where is the name #.#)
so first:i dont wanna create this folder by my finger
second:no root,not all users know root
i want my package name back when install the apk.
thank you very much.
myb you should clear/delete some memory or something..its just my opinion btw im still new in stackoverflow and android development too.
Good Luck!

Get applications package name

I am using Xamarin. I need to get the Google Maps API key and to do this I need my application's package name. How do I get this?
My app is called SimpleMapDemo and is one of the samples for using Google Maps.
Open your Manifest file and you shall find the package name of your application from the <manifest> tag.
Below is an example:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.recorder"
android:versionCode="1"
android:versionName="1.0" >
In the above example my applications package name is: com.example.recorder

Overwrite Android Application

I'd like to overwrite my old android application. What are the things i have to be do for that ?
Do Changes in AndroidManifest.xml is enough ?
I like to use another package structure and a new project to do so.
Regards.
Following are required:
Same key
Same Package Name
Higher versionCode in the manifest
The package name indicated in the manifest should be the same:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.company.demo.app"
android:versionCode="1"
android:versionName="1.0" >
If you're talking about the registration in Google Play, I think that only the package="..." attribute of the <manifest> node must be the same (and the version must be superior to the one of your first application of course).
It must also be signed with the same key.
That way, the Google Play site will recognize your old application as a new version, and it will replace the old one.

How to update my application on android market without changing version code

I have uploaded my app on android market.I did some changes,and want to update it again so I am getting the error.
"The new apk's versionCode (1) already exists"
So what should I do.Plese help me
Thank you
it is not possible as per my knowledge that without change your app version code, update app to market you must need to update it.
Go to manifestfile >> and set version code new
like this ::
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="your.package.name"
android:versionCode="2"
android:versionName="2.0" >
you get your manifest and increment the version code, example:
before:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="your.package.name"
android:versionCode="1"
android:versionName="version name" >
after:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="your.package.name"
android:versionCode="2"
android:versionName="new version name or not ^^" >
good luck.
You can not upload new installer same application package with same version code.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="your.package.name"
android:versionCode="1"
android:versionName="1.0" >
Change the version code (most likely incrementing it) in your manifest.xml.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="your.package.name"
android:versionCode="2"
android:versionName="2.0" >
you must have to change your venter code hereersion code
Just as an addition to Dr Nik's answer (sorry, my rep isnt high enough to comment), remember to save the amended manifest before exporting the signed apk, otherwise the changes don't go through and you get the same error. Exporting doesn't autosave. Had me frustrated for 20 mins until I worked it out.
For Android Studio you must also change build.gradle file which has defaultConfig method contains versionCode

Categories

Resources