[Q] Fails in an imported project - Android Q&A, Help & Troubleshooting

I just reinstalarme java sdk and eclipse and I've updated everything to solve problems that had versions had. Now, trying to create a project before importing interests me, not allowing me to use the light holo theme with dark action bar (The project I have to import the user and also gave me error related to it). I get a red x next. We also explain the mistake that gave me and before reinstalling everything and that gives me now, because I think it has something to do. It turns out that when you import a project gives me many errors: Errors in the files within src and errors especially in res / values ​​/ styles. the latter makes no father is and values-v21 speak. Many would say that the problem is the appcompat but I've tried a lot of solutions out there on the internet and nothing, I can not solve. Does not work with android studio me and if I have tried the techniques of builth path and etc. i need help please. The solution to start the application again is not an option, Thanks for everything
I add: when I go to project properties in android in paragraph libraries appear both me I have a red X (the appcompat and of google). They are in the project and if that I have downloaded everything you need with sdk (extras and others)

Related

Eclipse - Driving me mental, please help :(

Having a VERY weird problem with Eclipse and I cant work out for the life of me what is going on. Will be VERY appreciative if someone knows what the problem is here.
IF I create a new Android Project, it will save a folder with all the files to C:\users\silver\workspace
IF I create a android project from an existing source, the workspace folder does not contain the saved project folder.
Up until today there was no problem. Then for no reason as far as I can see, it went nuts on me.
Ive reinstalled and setup Eclipse. Ive even restored my PC to an earlier point to see if that would help.
If I cant work this out, its 2 weeks worth of work down the drain
Anyone got any ideas as to what the heck is going on?
Silver420 said:
Having a VERY weird problem with Eclipse and I cant work out for the life of me what is going on. Will be VERY appreciative if someone knows what the problem is here.
IF I create a new Android Project, it will save a folder with all the files to C:\users\silver\workspace
IF I create a android project from an existing source, the workspace folder does not contain the saved project folder.
Up until today there was no problem. Then for no reason as far as I can see, it went nuts on me.
Ive reinstalled and setup Eclipse. Ive even restored my PC to an earlier point to see if that would help.
If I cant work this out, its 2 weeks worth of work down the drain
Anyone got any ideas as to what the heck is going on?
Click to expand...
Click to collapse
Have you tried to import the specific project? I am sure the project which should be imported is an eclipse project. If yes you are able to IMPORT it instead of creating a new project from source. If not have you tried to cut the specific project from the workspace folder and then create a new project from existing source and choose the project esp. from your desktop and mark copy it to the workspace folder. (In some cases eclipse is not able to import/create a project if its in the workspace folder.)
If these things don't help. Update all the Android Specific Stuff. Update to newest ADT and SDK. And try it again.
If it won't work even after that i will need some more detailed information about your problem.
Good luck
Not sure why but it just went mental regarding anything I tried. Only way in the end was to copy and paste everything manually after creating the classes again
Back to square 1 at least well sort of...
I now have another problem lol.
I modified the SDK so I was able to use Internal API's, though I still have one error that I cant get rid off, which is...
"The import android.os.SystemProperties cannot be resolved"
Dont suppose you know how to modify the SDK to be able to use the whole source?
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums
Moving to Q&A
Bumpety Bump

[Q] Finding APK dependencies

Hey devs.
I have a little question. Let's say I have an APK, like the TouchWiz launcher( just an example ). Obviously, if i push it to /system/app on an AOSP ROM, it won't work, because it is missing some dependencies, or my android version is too low.
So, how do I find out which dependencies an APK needs, what android version, etc.
Thanks, Joe.
Please use the Q&A Forum for questions Thanks
Moving to Q&A
That's all listed in the APKs AndroidManifest.XML. I think the minimum Android version is listed as MinSDKVersion or something.
To view an APKs AndroidManifest.XML, use a tool like Root Explorer. If you're using RE, just click on the APK and choose View, then long press on the AndroidManifest and choose the option for viewing it in a text viewer.
- chris
GodSlayer said:
Hey devs.
I have a little question. Let's say I have an APK, like the TouchWiz launcher( just an example ). Obviously, if i push it to /system/app on an AOSP ROM, it won't work, because it is missing some dependencies, or my android version is too low.
So, how do I find out which dependencies an APK needs, what android version, etc.
Thanks, Joe.
Click to expand...
Click to collapse
Google for "APK Analyzer"
Same question here. Root Explorer is not very handy for this task. And I can't find "APK Analyzer". I need a desktop application.
maximilliangreat said:
Same question here. Root Explorer is not very handy for this task. And I can't find "APK Analyzer". I need a desktop application.
Click to expand...
Click to collapse
Apk Analyzer is a windows desktop app from Sony. But its for developers. I find it easier to just read logcat for FC's which will mention a nullpointer or missing function, then do a full text search for said function in the fully decompiled ROM. Takes a while doing that but it always works if you know your way around smali.
Sent from my X10i using Tapatalk 2
Apk Analyzer is a windows desktop app from Sony.
Click to expand...
Click to collapse
Good application, but heavily developer oriented.
I need a much simpler (and faster) tool, to quickly preview required android version, application name and version. Functions used by application are less important to me.
maximilliangreat said:
Good application, but heavily developer oriented.
I need a much simpler (and faster) tool, to quickly preview required android version, application name and version. Functions used by application are less important to me.
Click to expand...
Click to collapse
All this stuff is about the dependencies scanning, for the application name/version/etc stuff see my EDIT: post at the bottom
As far as I know, there is no tool made to do this. The nature of the Java/DalvikVM programming is much like other languages, modular. When the Android OS boots up, it preloads all classes and functions into the dalvik cache and registry, and if a seperate package (APK or JAR) references that function then the system loads it when it needs it. Apart from examining the .java source, there is no "header" or "include" file to see what other packages the package depends on.
Take this example - this is taken from a smali file from deep in the framework.jar for AOSP ROM's:
Code:
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
This is from ./android/net/http/IdleCache.smali. It is requesting to run the "uptimeMillis()J" function from ./android/os/SystemClock, it does not reference which JAR or APK has it. In this case it's the same framework.jar file, but Android has no idea about this because the classes/functions are preloaded in one chunk when the OS boots. Technically, you could remove these SystemClock smali files from framework.jar and put them in a file named "scoobydoo.jar" and the function would still work fine.
What I am saying is, the names of APK's and JAR's are never referenced in the decompiled smali code of an APK - only (sometimes) in the java source. So in the case of reverse engineering i.e. porting apps from one ROM/device to another where building-from-source is not possible, you would need to search every single smali file for invokes, member classes, etc. and then do a full text search for those functions on a fully-decompiled ROM to see where those functions/classes are.
This is why it's easier to just grab the APK you want, dump it into the ROM, and see what happens. Run logcat, run the program, when it FC's then examine the Error or Warnings relating to that package. It will probably mention "nullpointer exception" or "unknown reference" or something, I can't remember the exact message - and also the name of the function, like "Lcom/android/somepackage/somefunction()L" which it couldn't find, which caused the FC. You then would do a full text-search on either all decompiled APK's/JAR's, or on the ones you have a hunch on, and merge that APK/JAR file in too. If the JAR/APK already exists though, then it gets complicated - you need to merge the function into the existing package. Sometimes this is very difficult.
As I said, if you give me an example APK and a Logcat of it crashing, I will help But what you are asking for is a Package Dependency-Walker, which currently doesn't exist for Android. Such a thing would be nice though, as it'd make hacking a kanging much easier - but its useless for android developers because the original source code/project already shows its' dependencies (or, if written properly, has its' dependencies already included in the projects' build tree).
EDIT: Finding the required Android version however is easy. Decompile the APK and open AndroidManifest.xml, near the top you'll see a line like this:
Code:
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="10" />
Which means it's requires at least Froyo to run, but was targeted at Gingerbread MaintenanceRelease1 (2.3.3-2.3.4). For decoding the API integers, see here.
Application name and version are also in the manifest file. They commonly use values from the string table though (which looks like android:label="@string/app_name"), which means you need to search for that variable in (e.g.) ./res/values-en/strings.xml

[Q] Learning in eclipse, a few questions..

I've been searching to see if there is a way to use a clone of my phone as an android virtual device for eclipse, I've not found any answers..I'm beginning to think that it is not possible because I haven't found the "here's how to clone your phone as an AVD" thread anywhere..is this correct?
If that isn't possible, exactly how much if any modification can I make to the AVD to make it more like my phone (contacts, apps and settings etc), would I just find the AVD's files and replace them or are they packed in a zip/rar file or are they just resource files that are being called up that will change the behavior of every AVD that I create if I alter them?
Finally- what would you guys say the minimum system requirements for developing for ICS and compiling ROMs would be? Looking to get a new desktop, this 1.5ghz gateway notebook isn't going to cut it....
Thx!
(BTW..I've already started making apps..nothing useful but they worked, and I got them on my phone and functional...hopefully be able to contribute back to the community soon yay! )

[HELP] Decompile APK, fix, Recompile help

Hi, before all, sorry for my poor English.
I have buyed a new Android Watch; the SmartWatch U8. I have found many Android app to run it but nothing have great result.
After few test and search I have found the original APK for my watch, is run good but have some problems and I want improve it.
I have decompiled the APK (APK to ZIP, dex2jar and APK Tool), I have now some .jar files, the .manifest and few assets and others ressources.
Using Android Studio, I have tried to recompile, without modification of code. I have many, many errors.
Some errors is about depriciated, others is for unknown command or class.
I have tried to fix, but no chance, too many errors and my Java skill is realy low (I'm better under PHP). I have also try to copy only few codes using the error tools to known what is needed to add, but I don't known own the default structure was made (all class in same folder ?, or many folder for many class ? less class but with more actions ? not sure)
I have tried all ideas I have found, no valid result, I never build the app with success. I have made few Android App, with help of tutorials and are very basic (Web browser for my website, music player and scanner). I known the basic of Android coding and the new and old way to code them (Eclipse and Android Studio).
I search many solutions;
- [easy] Find another app with all (or the most) of needed change I want; hide the notification text but keep the icon when connected, more control of what is sending to watch (keep notice of call, but not make/answer call over the watch)
- [medium/hard] Find a good tutorial/guide for rebuild a Android app from decompiled APK.
- [hard] Build from scratch a Android app for my watch (with tutorial/guide)
The APK I try to edit: levelkro (dot) com/download/android/KHR1.3.22.apk (not available on Play Store)
Thank for your help

Open AOSP Application in Android Studio?

Is there a way that I can open an AOSP application in Android Studio?
I have tried just opening the directory but that does not seem to work, Then I tried importing the project it seems to work but then throws tons of errors. When I used Android Studio to clone the repo then import it it did not seem to work either. Took like an hour to index but then nothing seems to be showing up quite right.

Categories

Resources