[Q] running an application from terminal - General Questions and Answers

Hello.
I'm trying to debug an application that stops immediately after execution.
I think that first I need to know how to properly execute it using am (AcitivtyManager). after reading lots of posts regarding the issue here and on google things still aren't clear enough.
at the following URL:
http://forum.xda-developers.com/showthread.php?t=597096
I saw the following example that requires the package name and the Activity class name.
am start -n com.metago.astro/.FileManagerActivity
how can I find out the activity class name of an installed app?
in some other posts i read that the manifest file contains that information but I unzipped the apk and the AndroidManifest.xml seems to be compiled or something without any readable text. please enlight me on this issue. how does the android knows how to execute the application? what information does he stores and how!?? Can I extract that information to understand how to execute the app?
any information regarding the issue would be greatly appreciated, there are many posts, but nothing concrete.
thanks!
Kfir

Related

implementing Licencing service for app inventor apk

While following a tutorial over at androidworld.it I have created and edited a app inventor application that I would like to post up on the market.
Wile I was uploading into the developer console and publishing everything checked out fine until I hit publish. The old way for copy protection will soon be extinct and the following shows up.
The copy protection feature will be deprecated soon, please use licensing service instead.
Click to expand...
Click to collapse
To do this the apk file needs taken back down to source and ...
Integrating the LVL with your application code involves these tasks:
1. Adding the licensing permission your application's manifest.
2. Implementing a Policy — you can choose one of the full implementations provided in the LVL or create your own.
3. Implementing an Obfuscator, if your Policy will cache any license response data.
4. Adding code to check the license in your application's main Activity
Click to expand...
Click to collapse
The closest way ive seen on how to install this is ..
If you are developing using the SDK command-line tools, navigate to the directory containing your application project and open the default.properties file. Add a line to the file that specifies the android.library.reference.<n> key and the path to the library. For example:
android.library.reference.1=path/to/library_project
Alternatively, you can use this command to update the project properties, including the reference to the library project:
android update lib-project
--target <target_ID> \
--path path/to/my/app_project \
--library path/to/my/library_project
Click to expand...
Click to collapse
But decompiling the apk file with apktool creates no "default.properties" file
So I am at a loss on how to get this working.. Anyone recently get a app inventor app working on the market and figure out this part ? The tutorial has no info on this part. it may have been made prior to google implementing this.
Has anyone found a solution to this yet?
nicklantz did you end up with anything useful?
Any help appreciated.
Thanks
I have the same question.
anyone has the solution?

[Q] File Management and Locations

I've searched the forum on this, and unless I'm using the wrong key terms (very possible) I havent found any info contributing to this.
When downloading an app from the Android Market/Amazon Market, where exactly does the *.apk file get saved to? I like to have all my apk's in one area when flashing a new ROM, so I can just install them one after another (apps, widgets, live wallpaper, etc...)
Also, can anyone provide me with any info (preferably some link) in regards to Android's file management system, ie discussing in detail what folders hold what information and what that information pertains to?
One other question, what exactly is the difference between a filepath like:
mnt/sdcard & /sdcard in regards to opening/saving a file to/from those locations??
Apologize for the multiple questions, just thought Id save posts in doing so, and sorry if the information this is readily somewhere in the forum.
Thanks for any info on this!
EDIT: So I stumbled on the Android Developer's Site (feeling like a dumba$$)
http://developer.android.com/index.html
But I'm still unable to find an area pertaining to what I'm exactly looking for (the Directory Structure with explanation for GTablet Froyo) Am I missing something??
Dueces99,
Here is a start:
http://forum.xda-developers.com/showthread.php?p=12439780&highlight=Memory#post12439780
If you are rooted, use ES File Manager or Root Explorer or the like
to open up the file system.
Go to /sdcard and you will see the file system. Most of the file managers
will let you toggle to / and you can see the file system from the root side.
Literally, that's the basis and if you're a lot more knowledgeable than me
you can work down from there to the various sub-folders relating to the
OS functions.
Hope this helps get you started to where you want to go.
IMO, I don't ever get into the file system like I have done with Unix or Linux
in the past. Most of what I have needed to do under Android I just do using
one of the file managers like free Root Explorer.
Rev
P. S. -- When you hook the tablet to your PC and look at the "G:"
drive or however else it shows up in Explorer -- you are looking at /sdcard.
I understand what you are saying, and I am already familiar (atleast Id like to think so) with the main directories (sdcard, sdcard2, etc..) of the file structure, and what info. they hold. My tab is already rooted, and I have Root Explorer, ES FileExplorer, and Wifi File Explorer installed.
What I am looking for is a detailed description of what each folder (default Android structure) is for, and what information is stored in them.
For Example:
/acct: This folder holds...
/data: ...
/data/data: ...
/sdcard: ...
/mnt/sdcard: ...
Guess you could call it a Definition/Guide for the entire Android Directory Structure/Format?
Like in my initial post, where is the default location that downloaded apk's from the market go?
Sorry if my post was misleading, I'm just trying to gain a better understanding of the Directory structure just so I can better navigate through the various file managers and more efficiently find what I am looking for.
I would think the Android Developer's Site would have exactly what I'm looking for, but I haven't been able to find it. Thanks for your input though!
Dueces99,
I hope you find it.
I have made the statement before and I'll stand behind it, "The hallmark of Android as an operating system is its bad documentation."
Good luck!
Rev

[Q] Rar on android.

Hi:
I've recently started to develop my own comic reader. The problem I've come up with is cbr files, which are esentially rar files. Now I know there are comic readers out there (all of them, I think) that support cbr files. So there is a way of doing this, I just can't find how.
In the rarlabs official page (search google rar addons and it's the first page) there are several options. I would like to know if I download the commandline arm unrar how I could install it on Android (I have a motorola Xoom, it would be for Honeycomb), assuming that is correct.
If this is not an option is there a command line unrar application that I could call from my own? and How would the code be (to call an external application, that is)?
If the above is not possible, what is the way to get to unrar something in android?
The only real option I've seen would be to use junrar (hosted on github)
But it seems complicated and I'm not sure it works very well as I've seen a lot of conflicting reports.
Thanks for any help!
Try http://www.all-freeware.com/results/rar/for/android to unpack rar on Android.
Success,
Senax
Hi:
I'm not exactly sure what you wanted me to try. There is nothing in that page that would allow me to uncompress a rar file on android. Only a bunch of unrar utitilities and some android things but they are not related, that is, there is nothing that says unrar that also works on android.
thanks anyway.
Unrar
great app available here: androidzoom (dot) com/android_applications/tools/unrar_dhpu.html
Cheers,
Romuloxiii
Hi:
It's seems that I didn't make myself clear.
I want to develop an android application that needs to unrar files. Is there a way to call the unrar application from my own code?
If so, can you tell me how?
Otherwise, I appreciate the effort, but I can't use that.
Thank you very much!
You can bring the unrar binary along in the /asset of your app,
on first launch copy it to your apps /file directory, chmod +x it, and use exec("sh") to unrar the files from shell.
oh, I see. I think I get the the idea but I don't understand all the instructions.
What did you mean by importing thebinary on my asset?
If I do the step above why do I need to copy the binary on first launch?
Don't I need root privileges too chmod it? And how do I do it from my source code?
And finally where can I find the command line use of the application? Or is it the same as the Linux version?
I know there are a lot of questions, but please keep in mind that I'm very new at doing this.
Thanks for all the help!
You need to put it as asset to bring it along.
You need to copy it because asset files are not directly accessable.
You don't need root to chmod the file in your own directory.
You do it by using a shell from your code i.e. Process.exec("sh")
And finally you want to program the app not me,
so don't be lazy and invest some time.
Google google google google...
If there are still questions left after that, you may ask again .
Ok, I'll try it and get back to you!
Thanks!
Sorry for my lazyness, but I've been Googling for a good half hour without finding a simple 'unrar' binary executable compiled to run from terminal on rooted ARMx32 device. I don't want bloated GUI APK's or libraries for development implementation, but just the plain command line interface executable. Anyone, please? It's a pity they haven't baked it into Busybox as an applet, IMO.

[GUIDE] I will show you how to have multitouch with App Inventor 2

I have seen that there are a lot of questions on how to be able to multi touch in App Inventor 2. As you may know already, App Inventor 2 does not support multitouch natively. But you can use a workaround so that your app will have multitouch capabilities in the final .apk.
This method will work for 2 or more different objects such as 2 buttons, 2 canvases, 2 sliders etc. It will NOT work for the same canvas.
What you need:
1. An App Inventor 2 project with at least 2 buttons, canvas, sliders etc
2. AppToMarket_v32 (the most recent at this moment of posting): https://code.google.com/p/apptomarket/downloads/list
Steps:
1. After you have created your app, build it and save it to your computer in .apk format
2. Download AppToMarket_v32, extract the files from the archive and place it somewhere you will find it easily
3. In the AppToMarket folder, open runMeWindows_v32.bat, This will open a command window that will then open the program.
4. Once you have the app open, enter whatever you want in the Certificate Details tab, then click "Generate"
5. Go to the next tab (De/Re compile and wrap-up), click "Browse" and point the path to your apk, then click "Decompile"
6. In the "Features" menu below, change the "Min SDK Ver" to 5 and "Target SDK Ver" to 11. If you don't want your app to be resized, change the slider to "Normal"
7. Click on the "Update Manifest" and "Create New .apk"
8. DONE! Your new apk is in the same folder as your old one, but with the name changed (apkname_new.apk)
If you want, I can make a youtube video with step-by-step instructions on how to do everithing I said above. Just say it in the comments.
.APK can't be decompiled
I have a problem:
When I press "decompile", I get the error "ERROR: Unable to decompile your .apk file". I tried downloading it again from the App Inventor page, but it gave me the same error over and over again. Does anyone know how to fix this?
Are you sure you have generated and saved the certificate details? Try and put other detailes there and click generate, it doesn't matter what you write there as long as you don't plan on selling the app on the market. Also, is your path to the apk file correct?
hi, thanks for the guide, but i have a problem, when i try to install the new apk in my android, i have a error, in the package analisys.
i read that downloading from drive was tha solution but not, i still have the same error, i try to install the apk of app inventor to be sure, and this apk install without problems.
do you have any idea of the solution for this problem?
thanks a lot for your help.
sorry for my english
Hi, sorry for responding late. Try signing the apk after you create it (there is a button which says Sign Apk in the right)
Hi!
I have followed the steps of the guide (thanks for it!), but I had a problem while modifying the SDK version. Using the fields for Min SDK Ver and Target SDK Ver adds nothing to the manifest, so I tried writing it by hand:
I've tried to edit the manifest with AppToMarket as indicated in Gareth's post and other guides I've found, but when I add the line <uses-sdk android:targetSdkVersion=11 /> AppToMarket gives and error while rebuilding the APK and doesn't create the new file. I added this to the manifest file:
...
<uses-sdk
android:minSdkVersion=5
android:targetSdkVersion=11 />
</manifest>
But when I add this, AppToMarket shows an error while creating the new .apk (no more info, just says there has been an error).
There is another issue. No matter which size I put on the slider, it always resizes my app...
Any idea about why is this happening and how to fix it?
Thank you !
AlexKapa said:
I have seen that there are a lot of questions on how to be able to multi touch in App Inventor 2. As you may know already, App Inventor 2 does not support multitouch natively. .
Click to expand...
Click to collapse
Dear friend,
Thank you for your tutorial. But, can't install the app. "Invalid application, Stop Installation". :crying:
I'm using the "App to Makert V4.0". I can't find the "32 version" , seems "deleted" . My smartphone for test has the android version: 4.1.2 and Kernel 3.4.0.
Thank you.
I have followed the steps of the guide and installed to my smartphone successfully.
But it still can't multitouch two canvas at the same time.
What is the problem may happened?
two canvas
shihchieh said:
I have followed the steps of the guide and installed to my smartphone successfully.
But it still can't multitouch two canvas at the same time.
What is the problem may happened?
Click to expand...
Click to collapse
Hello ! I have followed the steps too, and no multitouch on two canvas. Did you found the solution ? Thanks.

Need help modifying an APK

Hello! Sorry if this is the wrong place to post this I just registered to the forum!
To keep it short I am a frequent player of the game 'Idle Heroes' and I got the idea to take the APK, modify it (for private use of course) and give me resources in the game so I can try out different heroes etc etc.
So I read up on the APKtool and all that but I am having some trouble, I can't find the framework I need.. I am just getting errors when trying to decompile and I can't find any framwork in my phone or online to download..
Any help is appreciated! Thanks!
If it's any help I have a Galaxy S9 (not rooted)
For apk tool you need to write it in the following format in command prompt... (assuming you are using apk tool 2.2.4)
Java –jar apktool_2.2.4.jar d C:\<path to apk file>
But this would give you stuff like the android manifest. If you want the raw source code itself, you would need to use something such as dex2jar. Format is below.
d2j-dex2jar.bat C:\<path to apk file>
mohhaxs said:
For apk tool you need to write it in the following format in command prompt... (assuming you are using apk tool 2.2.4)
Java –jar apktool_2.2.4.jar d C:\<path to apk file>
But this would give you stuff like the android manifest. If you want the raw source code itself, you would need to use something such as dex2jar. Format is below.
d2j-dex2jar.bat C:\<path to apk file>
Click to expand...
Click to collapse
Thanks for your reply! Unfortunately I'm still struggling.. As you said it's the source code I am after. If you haven't played the game I'll try to explain what I am after.
Every day you get daily missions you can do, I'd like to simply change the rewards from let's say 1 summoning scroll to 1000 so that each day I can get 1000 scrolls, and I also want to change the other rewards to give me a couple of thousand gems instead of the 20 I get each day, that will give me enough to get the heroes I am after!
Would you care to help me a little more specifically on how to achieve this? Right now I have put the .apk in "C:\android\apktool" along with the apktool itself (apktool.jar).
But I don't have a .bat file, what kind of .bat file do I want to create? Also I don't have any other folders or such. And yes I have the newest version of Apktool!
No matter what I write in CMD it gives me an error, I don't have any framework files etc and I don't know where to get them.. I did also use the code you gave me (java -jar etc etc) but it also gave me errors .. If you'd like me to try something else and/or post the errors here I'd gladly do so!
Sorry for being such a noob but I have never done anything like this before, I recently started learning C++ but it's mainly simple games (for PC) in UE4 and stuff like that, but nothing for mobile.
Thanks a lot for your time!

Categories

Resources