(PROBLEM)
I want to transfer an app that according to the storage tab in my settings has 5gb (the app requires you to download a lot of files after initially installing it), but every app that I've tried (like Syncios for example) has only given me access to the 80mb apk, without any dex files. The iTools app that I used back when I had an iOS device would always transfer the entirety of an app's files from the get-go, so I am really in the dark about what the issue could be.
(context)
I wanted to make an online community revolving around a fairly obscure mobile game, which means that I need some game assets to make it look nice. I had a very consistent way of doing that with iOS apps, but now that I've switched to android, nothing I do seems to work.
I want to know how parallel space
https://play.google.com/store/apps/details?id=com.lbe.parallel.intl&hl=en is working. It is an app for logging in with another facebook, whatsapp etc account. You can find the detailed description in the play store link.
I have looked at the folders that parallel space is creating using ES Explorer. They have created the following folder parallel_intl/0/
In this folder they have DCIM, Pictures etc folder. I logged in another whatsapp account using parallel space and they created the whatsapp folder at the following location parallel_intl/0/Whatsapp
Is it possible to achieve the same thing with Android For Work Container???
Are they some how creating a separate space where Whatsapp etc will run???
Kindly provide some guideline explaining how this can be achieved.
Thanks.
Actually they have created a virtual OS named multi-droid where you can run any app on that OS. As you install any app on their OS the space for that app increases by the size of the app. Firstly they find the path of your installed APK then they copy that APK into somewhere in the directory
Thus they have the APK to install . now they run it on their OS and they took all the permissions required by the app that way all the permission could be obtained .then the app has a service running in background so notifications can be obtained .
Is it possible to create an .apk file that only update an image in the existing app? my app is an in-house app for corporation, not in the play store, mainly contain of images (in the resource folder), and i just want to create a patch (an apk that is significant smaller size) that only update one of the images in the existing version.
If you want your app change image in the res folder of another app it may be possible(not sure it can be impossible at all) for rooted devices.Because all app folders created by the android system for the installed application are protected and can not be accessible for another processes.
But if the image was created on SD-card or on the shared device memory it is not a problem.
I have an app that allows exporting files to a non-standard folder on the device's file system.
I put the exports in a folder separate from the application data, because I want the user to be able to navigate to the files using a file-system explorer, and the application data folders/files are not accessible that way.
However, when the application is uninstalled, those non-application-data folders, the folders separate from the application-data file structure, are left behind.
Is there anyway to call an uninstall script, and if so, how is the script called/executed when uninstalling through Android Market or through the device's uninstall in the settings for 'Manage Applications'?
Intent.ACTION_UNINSTALL_PACKAGE
I believe this should work for you. Unfortunately, it's for API 14. I don't know it that falls into your needs.
My guess is that the contents of .apk package are extracted somewhere, and the application is registered at some directory so that the application launcher or whatever can find it. But is that all? If that is the case, is the original manifest.xml read every time the app is launched or it gets pre-processed into some other form?
Disclaimer: This answer is now 10 years old 🎉. While overall probably still accurate, details have definitely changed (ART instead of Dalvik, dynamic vs. static permissions, etc). Take it with a grain of salt!
Some basics
The .apk-file
An .apk-file is not magical at all. It's just a bundle of files which represent the content of an Android application. If you open it in a archive-tool (like 7Zip), you can browser and extract it's contents.
Android is Linux
The basic Android-System is a Linux system. Android uses a custom Linux kernel with some extra functionality on power-saving and some speed-improvements. The internal storage of an Android device is formatted with the YAFFS2-filesystem, which fully features the Linux-like access-concepts.
The used file-system might differ by manufacture or Android-Version. Newer devices often use ext3, while Samsung uses it's own file-system: RFS
This is one important aspect of the Sandbox-system, which is used by Android.
Compiling applications
What happens to the .java-files?
First, they are compiled by the normal Java compiler. After they are compiled (to .class-files), the dx-tool from the Android SDK then converts/transpiles those "normal" java-classes into Dalvik-Bytecode.
This "special" java-code is then interpreted by the DVM (Dalvik Virtual Machine), which is based on the opensource JRE-implementation Apache Harmony.
Update: In newer versions of Android, the convert/transpile step can be skipped when jack is used. This way, the .java files are directly compiled into the .dx format.
Also, since version 4.4 (KitKat) Android has the new ART runtime, which officially replaced Dalvik in Android 5 (Lollipop).
What happens to the resources i put into the /asset-directory?
Android offers the /assets-directory to add some binary raw-files (e.g. a SQLite Database). Files which are put into this directory are not compiled or optimized.
If you put your files into this directory, this is the kind of behavior you would expect from Android.
What happens to the resources i put into the /res/raw-directory?
Like the /assets-directory, you can also put binary (or other) raw-files in here (e.g. HTML-files for the Help-page). These files are compiled/optimized (if possible).
What happens to the Manifest and the other XML-files?
The Android-Manifest and also the other XML-files (Layouts, Strings, etc.) are stored and "compiled" into a binary XML-format. This is a speed-optimization.
The Sandbox
From Android OS point of view, a single Application owns:
it's own process,
it's own OS-User (like on Linux),
it's own DVM,
it's own place in the heap and
it's own place on the filesystem.
So yes, every Android app has it's own user which has the proper rights to access it's place in the internal storage (which is protected by standard Linux filesystem rights-management) and it's own DVM-process (which can't be accessed from outside of the application).
To give the application the possibility to leave the Sandbox (e.g. to connect to the Internet), the permissions declared in the Android Manifest are used.
Steps during the installation
So from the above explanations, it should be clear what happens when an Android-Application is installed:
The new user for the Application is created.
With this new users rights, the Applications directory in the internal storage is created.
The contents of the .apk-file are being extracted there.
The Android-Manifest is parsed and the declared intent-filters are registered (e.g. the android.intent.category.LAUNCHER-filter for the applications standard entry point).
Now the application is ready for it's first launch.
When you install an app, Android System copies its APK to "/data/app" folder and it named it by the package name followed by the installations number (how many times you install or update the app).
I tried to install an app manually by copying its APK and paste it in the /data/app folder and rebooted my device then it appears as an installed app and works perfectly.
Also I noticed in the link2SD app that any installed app has the folowing:
Apk located in /data/app/package-number.apk
Dex located in /data/dalvik-cache/data#app#package-number.apk#classes.dex
Lib located in /data/data/package/lib
Data located in /data/data/package
Cache located in /data/data/package/cache
Android defines an intent as "an abstract description of an operation to be performed." Not only do intents let you use activities made by others, but they are also used to launch applications. I'm sure you've seen these lines in every app you've written:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
This intent filter allows the launcher to find the starting activity of each app. Lookup "intent resolution" for more details on this process... I'd say it's more elegant than simply registering the application at some random directory.
As stated in, http://developer.android.com/guide/topics/intents/intents-filters.html, "Android system populates the application launcher, the top-level screen that shows the applications that are available for the user to launch, by finding all the activities with intent filters that specify the "android.intent.action.MAIN" action and "android.intent.category.LAUNCHER" category. It then displays the icons and labels of those activities in the launcher"