Starting Runtime.exec() directory - Android Software Development

Could someone tell me what path runtime.exec commands start in? I'm making a simple JIT program and I already have the enabling in the build.prop done, I just need to copy some files from the resources folder. Also can anyone provide input as to wether that would be legal to put on the android market as it would contain some dalvik files? If not, I know some apps get around it by downloading the files to sdcard which would be fine for me but I'm unsure how I'd do this in an android program. Thanks for any help!

Related

Portable Webserver for APK files

Hi guys,
I have just been playing around with the idea of hosting a webserver on my machine that my phone could connect to to download apk files after performing a wipe.
Iv been thinking about this as everytime i wipe my phone i connect back to the market and download appmanager to install apps direct from sd. So instead of having to do that im looking at having them all in a directory on my PC/Flashdrive (as this will be portable) using XAMPP.
Before any gets any wrong ideas this is not intended for any illegal doings. Its just to make my life easier. I thought i would share what i have started to see if this will help out anyone else.
So far i have it working (very rough). But i dont know any coding so this is a bit of a hack job.
I am using XAMPP as stated aswell as a PHP script that will automaticly populate the page will all files within a particular folder.
I have attached the index file i am using.
if you wish to use this please make sure you do a few things.
Install XAMPP
From where you installed XAMPP. In the HTDOCS folder create a "APK" Folder
Place the index.php in the HTDOCS folder
Edit the index.php file to change the path of the APK folder (currently set to D:\\Dream\\xampp\\htdocs\\APK) keep the double slashes "\\"
Start the Apache webserver from the XAMPP control panel
Now connect to Localhost, any files you place in that folder should now appear
Anyone wishing to use this, edit this, whatever you feel like. Go ahead
If you would like to help and change the look and feel of the page it would be greatly appreciated. If you do post the files back up here for all to use
Hope you guys like
Can I ask why you wouldn't just backup your apps to your sdcard (use something like MyBackup) and be done with it?
You can always copy them from your sdcard to your flash drive (and back from flash drive to sdcard temporarily if you need to re-install).
I'm all for experimenting, learning and even playing around a lot. But this seems like overkill. First off, your apps will surely get outdated quickly, and you'll end up upgrading lots of apps. You'll end up spending an enormous amount of time managing your own local library.
Personally, I think you're wasting your time unless your trying to learn how to do something in the process. Maybe you are, and in that case, go for it. Otherwise, enjoy your phone and let the Market do the management for you.
Or you can just have all your .apk's in a folder and use adb to install all of em at once. But like the above post you might have to get updates for alot of em.

WebView help needed

Hi guys and gals I am having a issue with my app I'm making. The app uses webview to load a special web page to let a user download files mostly .pkg files but some zip files and exe's as well. I have the app built and it loads the website url I need it to but when I click on a file to download it to the storage card it does nothing at all. I know I need to do something with the DownloadListener I'm just not sure what or how. The snippets of code I have found on the net to try to understand it has not worked. I have given permission to the net and SD card in the manifest file. Any help with this would be great Thanks
p.s. for some reason it wont let me post my code. if anyone can help + rep for you
No one on this? ok well I know I need to set up a downloadlistener but I am unsure how to do this everything I have found is only to force media to be played somewhere but I need to just make it download the file to the root of the sdcard. any help even to a good tutorial or link with a code snippet for a different file type that i could modify to work would be very helpful

How to extract data.img files with PC? Because my Android won't start.

Hi guys,
Somehow I screwed my Android and now I can't use it (android.process.acore force close keeps popping up). I don't mind doing a fresh install as long as I can keep my game datas. Unfortunately haven't done any backup. So, is there any way to do that from PC as I can't start my Android? Just for info: the games are zenonia and angry birds. Thank you very much.
dan138zig said:
Hi guys,
Somehow I screwed my Android and now I can't use it (android.process.acore force close keeps popping up). I don't mind doing a fresh install as long as I can keep my game datas. Unfortunately haven't done any backup. So, is there any way to do that from PC as I can't start my Android? Just for info: the games are zenonia and angry birds. Thank you very much.
Click to expand...
Click to collapse
Just copy all the data from the memory card into a folder in your PC(i am sure you know how to mount your memory card , just take it out and put in into a card reader or mount it in Windows mobile), but that does mean all the faults you have might get accompanied along
All the apps you download and install is in the data.img file. Just redownload your build and put your data.img file in there. It'll will be as good as the working system...if that works, just copy over the other folders from your sd card root. I suspect the files corruption is only in the Android folder. Good luck
nope. copying the data.img file to a new build still produces the same result. as I said, I screwed the data.img file.
I think you need to have linux running on your system to be able to view the data.img file because it is a linux filesystem. Download a ubuntu liveCD and run it on your computer OR ubuntu through vmware. I don't know the exact ways to get to the files but this is the start. I think someone already have a tutorial on this somewhere in the HD2 Android general section. Check there. Goodluck.
how to mount data.img
I still have the problem that I srewed up my data.img
Android boots but I only get a black screen.
When pressing buttons (End Key) I can see Menus and feel vibra feedback.
I have debian Linux
How can I mount my data.img
debian40:/home/erich/Desktop# mount -t udf data.img ~/img -o loop
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
Click to expand...
Click to collapse
Would be gr8 if a linux pro couldguide me
Greet`s Erich
This will work in Windows-based Computer.
Download and extract the attachment.
Run the exe file.
Click new (first icon) and navigate to the data.img you want to check and click to select.
You can extract/save all or select the files on that data.img by navigating through the files on the left side of the window then click save (4th icon) then navigate where you want to save it.
If you need more help, just PM me.
***Why do you have to make life difficult?***
jose makalolot said:
This will work in Windows-based Computer.
Download and extract the attachment.
Run the exe file.
Click new (first icon) and navigate to the data.img you want to check and click to select.
You can extract/save all or select the files on that data.img by navigating through the files on the left side of the window then click save (4th icon) then navigate where you want to save it.
If you need more help, just PM me.
***Why do you have to make life difficult?***
Click to expand...
Click to collapse
Very handy tool here. Had to try it to see for myself. And it works. You will find all your apps and game's data in the data folder. Just copy the folder for angry birds onto your phone in the /data/data folder and your progress in angry birds will be restored. You can even use this program to backup all your installed apps (.apk) including your paid apps.
disable Autostart - or DELETE Autostart Tools
Yea great way
Thank you
Does anybody know where the "autostart" folder is located under Android?
Because then I could try to fix my data.img.
In WM6.5 its easy to locate,...
I am sure it was a Launcher tool which srewed up my system,...
Guess that this could help for sure other users - when it would be possible to boot Android without AUTOSTART of installed proz
many Greet`s
Erich
jose makalolot said:
This will work in Windows-based Computer.
Download and extract the attachment.
Run the exe file.
Click new (first icon) and navigate to the data.img you want to check and click to select.
You can extract/save all or select the files on that data.img by navigating through the files on the left side of the window then click save (4th icon) then navigate where you want to save it.
If you need more help, just PM me.
***Why do you have to make life difficult?***
Click to expand...
Click to collapse
i can't delete apps
is there a way i could delete apps?
Sooo....
Hey guys!!
I've been a member of the forum for a while now and am trying to contribute more to everything. I think this was a very helpful post but I don't know how to do the whole thank you think like everybody else does. Can someone help me? Thanks guys.
modifying data.img
i can't delete apps
is there a way i could delete apps?
Click to expand...
Click to collapse
I also had this problem - it`s read only
Would be nice if someone finds a solution to delete stuff.
Because if the data.img is srewed up - deleting stuff would be gr8
I just copied the things I need and set up a new data.img to this I put the extracted stuff,...
GreeT`s Erich
No files
I tried ext2explore with my 170Mb data.img (created with clockwordmod recovery), but I can't see no files, no directories, nothing at all, the application is blank.
Any suggestion?
EDIT:
Solution found here: http://forum.xda-developers.com/archive/index.php/t-705800.html
deleted - posted to wrong location
love this tool, essential thanks for sharing.
Super cool....
jose makalolot said:
This will work in Windows-based Computer.
Download and extract the attachment.
Run the exe file.
Click new (first icon) and navigate to the data.img you want to check and click to select.
You can extract/save all or select the files on that data.img by navigating through the files on the left side of the window then click save (4th icon) then navigate where you want to save it.
If you need more help, just PM me.
***Why do you have to make life difficult?***
Click to expand...
Click to collapse
help
i screwed my data.img and had to create new, now i need help to get my contacts mesages from my previus data.img can anybodey help? where are the located?
Modifying a mounted data partition
eriche said:
I also had this problem - it`s read only
Would be nice if someone finds a solution to delete stuff.
Because if the data.img is srewed up - deleting stuff would be gr8
I just copied the things I need and set up a new data.img to this I put the extracted stuff,...
GreeT`s Erich
Click to expand...
Click to collapse
adb remount

[Q] apk file issue!!

I have a confusion regarding android. this is very general query.
In Computer, first we have to have exe file to install anything and then we click on it to install the app on windows computer generally. when the app is installed on computer, we have installed app files in program files and then a dump (that is exe file) which we keep to install this app on any other computer.
Now, please let me know if this is applicable in android phones also?
I know that in android, there is .apk file instead of .exe file in computer. I observed that after installation apk file disappears. Is this true?
Not sure if in understood well, did you mean if instal anything from SD card? If you are asking that the answer is yes, i install everything from SD card and the apk file stay there after installation.
What if u install any app from Market?
vijay.gupta said:
I have a confusion regarding android. this is very general query.
In Computer, first we have to have exe file to install anything and then we click on it to install the app on windows computer generally. when the app is installed on computer, we have installed app files in program files and then a dump (that is exe file) which we keep to install this app on any other computer.
Now, please let me know if this is applicable in android phones also?
I know that in android, there is .apk file instead of .exe file in computer. I observed that after installation apk file disappears. Is this true?
Click to expand...
Click to collapse
Even in Android you can see the .apk files under /system/app. Also applications installed by you can be backed up & later restored using software available on market.
"Normally" these apks dissapear when you download from.market, but all of.your apks are stored in your phone, the thing is that you have to hav permission to do that, when you download an apk (the single file) and store it in sd card to install it, the apk is copied to the phone.
Sent from my GT-I5801 using XDA App
But if u back up ur apps as .apk and install them later using softwares (with exception of Titanium backup) u will loose connection between the app and android market (that means no updates)
the best option is to backup ur apps with titanium backup along with user data and restore it using the same
how do i access /system/app? Do I need to root the phone in order to see this directory?
vijay.gupta said:
how do i access /system/app? Do I need to root the phone in order to see this directory?
Click to expand...
Click to collapse
Download Terminal emulator from market & you are ready to go to /system/app !!!!
You can also download Root Explorer and so the same
Thank all. Can you please confirm what I am writing below:
Suppose I buy a android phone (with android 2.1 so you cannot install apps from SD card) in which I installed an application named XYZ from Market. Now, there is a apk file for XYZ which gets downloaded somewhere in the phone memory and then it gets installed automatically.
Now, I just want to know, where does this apk file go after XYZ is installed? Does it stay in phone memory with the installed files of XYZ.
If it goes to phone memory and not deleted from there, then phone memory
if u install .apk from market it will be stored and installed in /data/app in phone memory. i do not think it is stored twice in the phone.
Do u mean to say that only the installed file gets stored and. apk. File got deleted automatically after getting installed?
vijay.gupta said:
Do u mean to say that only the installed file gets stored and. apk. File got deleted automatically after getting installed?
Click to expand...
Click to collapse
Remember that an .apk file its a variant of the .jar files when you install an .apk this file gets stored inside the phone along with its necesary dependencies when the app starts, the os reads this file line by line while the app is executed.
In short terms the .apk file its the application itself that need a proper interpreter to run, in that way when you install and app to the phone, it copies this file and links the dependencies, so the .apks downloaded from makret are stored directly inside the app folder, in that way you can extract them from this folder and use it in another android phone.
You are relying too much on the windows ways of things. You see an exe file installion in windows essentially unpacking everything (other things aside) where it is needed and you then often see a bunch of files and folders. This is not what happens in android, the apk file is conserved when installed and can be found in the root part of your phone. Its data/app/ if installed on your phone, mnt/asec. (or something like asec) if installed on your sd card. You can copy that file to your sd card or send it to another device and install it again. I did just that today (I sent an apk to a friend)
anyway i dont think its same if i delete .apk + odex files from /data/app as i uninstall it with titanium backup. i think TB will be delete also data stored by the app inside the database (its the place where the apps are saving data, settings, etc...)
In case you are installing from Android Market:
1. When you are at market, it doesn't ask you to download. You will only get option either to install or update the existing app.
2. If you are a normal user, after installing, you won't be able to see the apk file anywhere on your memory card. But if you are a root user or with the help of special file managers and specific apps like root explorer and terminal emulators, you can locate those spk files in the phone's hidden memory.
3. If you are a root user, or with the help above mentioned type of apps, you can locate the apk files in phone memory and copy it on your memory card and distribute it to your wish.
4. If you are worried for paid apps and losing your phone or apps because of resetting or any other reason then stop worrying. A record of your paid apps is stored in google servers. So, even if you reset your phone or lose your phone, once you log in to a your new android device with the same google account, it will automatically show your paid apps. You don't have to pay for it again. Just need to install it again. This is applicable only if you are paying for the app through android market and you are logging into your android device with the same google account you had before losing your apps.
In case of installing via your SD card:
1. apk files are just like java files (.jad or .jar). You can download it on your PC from various sources and transfer it to your SD card or any of your friends' via USB, bluetooth or any other way.
2. After transfering the apk file to your SD card, it doesn't get automatically installed. You have to click it or open it to install, just like how we double click the exe file in windows.
3. Whether installed or not installed, the apk file you transfer to your SD card will always remain there unless and untill you or someone else delete it or you format your memory card.
4. Once installed, a copy of the same apk file would also be there in your phone's hidden memory, which you can access using special apps.
If you worried about losing your apps, try searching for other apps which backups apk... you can do so at android market. Moreover, also search on the net about having root access on your android device.. it'll let you access files in your phone's memory.
I hope, this would solve down all your queries !!!
Thanks next2 devil. Very gud explanation. It cleared almost all confusions. I have some more confusions that i want to clear out.
1) just a general query that just like exe file got unpacked after double clicking on it and install its files in c: genrally, does the same happen with apk, jad and jar files?
2) just want to clear out that phone memory which is hidden for normal users contains the copy of only those apk files that are currently installed on the phone and not the ones that are uninstalled or not installed at all?
vijay.gupta said:
Thanks next2 devil. Very gud explanation. It cleared almost all confusions. I have some more confusions that i want to clear out.
1) just a general query that just like exe file got unpacked after double clicking on it and install its files in c: genrally, does the same happen with apk, jad and jar files?
2) just want to clear out that phone memory which is hidden for normal users contains the copy of only those apk files that are currently installed on the phone and not the ones that are uninstalled or not installed at all?
Click to expand...
Click to collapse
1. I am not sure about JAD and JAR files, but yes, APK files unpack itself to get installed. You can come to know the exact size/space that would be taken by the app directly from the android market. Details would be given there.
2. Yes, the phone memory would be having copy of files only which is installed. There would be no copy of any apk file which in not installed.
Thanks next2devil. Your response give rise to one more query.
if i compare unpacking logic from windows, there is no need for original exe file to remain in existence after it has been installed and user can delete exe file after installing it. Deleting exe file has no negative impact on the working of installed app. Please let me know if this is also the case with apk files? If yes, then what is the need of apk file to remain in phone memory after it has been installed?
vijay.gupta said:
Thanks next2devil. Your response give rise to one more query.
if i compare unpacking logic from windows, there is no need for original exe file to remain in existence after it has been installed and user can delete exe file after installing it. Deleting exe file has no negative impact on the working of installed app. Please let me know if this is also the case with apk files? If yes, then what is the need of apk file to remain in phone memory after it has been installed?
Click to expand...
Click to collapse
Short and simple. Deleting the apk file from /data/app removes the app.
Sent from my Lestatious v1.4.5.5 Galaxy 3 FROYO

Cannot Extract APK

First ok all, Move if not in the correct spot (Or Delete if against TOS)!
Unsure if this is possible but I'm trying to extract an APK (Not sure if I should mention the App, I Did purchase the app) to make a small change to the code. I Can get to a certain point of extraction and then it stops. The files I need to edit are extracteded however so I can change what I need to, but as files are missing, when I recompile the app does not launch.
Any thoughts? Suggestions?
I've tried both APK Studio & APKTools

Categories

Resources