Help With Eclipse Running an Android App (First Post) - Android

Hi all I am a noob when it comes to this, I just started to make my phone app and I have it completed with html javascript and jquery. I have been having some trouble when running it in Eclipse. Well thats the problem Im not sure what to do to get it to work in Eclipse. It runs on the browser but i cant get it to work on my phone and not sure where to start and what files I should keep when starting a new project? Any Help would be greatly appreciated. Thanks

More on question
Ok i have it down to one error i keep getting when i run it. I am trying to connect to the html file and i get an error saying "Network error, "files:///android_asset/www/index.html" Im not sure how to fix this and have been looking everywhere. My code works perfectly in a browser but this error keeps popping up when testing it. Please help

i think you mean webkit view
Normally with eclipse, java applications are compiled with the provided android sdk.
With html / javascript you can bypass this (as I'm assuming you have done)..
when you are creating your android project in eclipse, in your main activity's layout xml file,
make sure you have the webkitview declared..
Code:
<WebView android:id="@+id/web_engine"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
This would inform eclipse that you are going to need a web display view,
now in your mainactivity.java.. find your webkitview
Code:
browser=(WebView)findViewById(R.id.web_engine);
to enable javascript stuff
Code:
browser.getSettings().setJavaScriptEnabled(true);
and to load the actual page,
Code:
webView.loadUrl("file:///android_asset/filename.html");
and also remember google is your friend : search for "android webkit loading local javascript assets" there are tons of queries in stackoverflow too..

Related

[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

Developing apps for GN2

I see that most development chat here is for system software, kernel, etc.
I would like to begin writing apps for the Android OS. I have a GN2.
I've installed Eclipse and have installed the last few SDK versions.
I eventually want to build an app that will allow a user to log into a web site and retrieve data from a database file on the web server using other phones also.
I'm an old Visual Basic programmer and have a little C# familiarity. Don't know much Java at all.
What else might I need to download and install into Eclipse to be able to write an app to access a database file on a server?
Anyone know of any app templates that can I can download and start off from to learn the process of writing such an app?
The database will be mySQL probably. Could be an Access or Sql Server file.
Thanks in advance,
Barry

[Q] Fails in an imported project

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)

[APP][MOD] Remove device/OS check

Hi i've been browsing the forum trying to find a solution but however i'm limited by my knowledge.
Basicly there is an Game/app made built by GameMaker but the target system was not meant to support AndroidTV. I'm trying to run this game on my nvidia shield.
I sideloaded the app and whenever i launch it i see the background of the game as if it was going to work and then the app crash and i get the following error message :
Incorrect android target. This executable targets android TV devices. This build is for android".
I've download Apk Studio / Apk tool and i tried to find out in the code where would that check happen and how i can allow AndroidTv devices to run this app. However i don't see much in the manifest file that would stop the app from running in AndroidTv.
Anyone out there with more knowledge can chime in and give some ideas ?
Here is a link to the app i'm trying to modify.
https://drive.google.com/open?id=1LrddBPcAK9Ufs9Eo8Jl5Z_zTTDvKzzHO
Thank you

Urgent help please

dear community i hope everyone are doing fine, so am gonna go straight to the point
i have a Magisk on both mobile and emulator with all important plugins installed + Frida well installed + many http interceptors + installed the http interceptors certificates in the root ...
- now i have a game that i want to mod and i want to explore as well. the problem is i spent the last 4 days decompiling it and reading it's source code and i couldn't find any urls i even tried using frida to bypass the ssl pinning and i did bypass the ssl pinning and the root detection and still no links and when i use burpsuite the game show other links that has no relation to the game api.
also to mention that when i use this tool HTTP Toolkit and i setup the tool with adb to intercept the calls the game says that the connection to the server is lost and game freezes .
i tried every possible solution before coming here trust me and the last thing is i found these errors in the output from frida which i couldn't find in the source code because there is no functions named
HTTP.SecureProtocol.Org.BouncyCastle.X509.Store
BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls
......................................
now my question is : can someone give me any idea on how to get the requests without letting the game freezes
another question : if the links aren't present in the apk source code from where the tool is getting those links to perform the api calls
third question : is this has any relation with libraries .so ?
-----------------------
Game Url : https://play.google.com/store/apps/details?id=com.lockwoodpublishing.avakinlife&hl=en&gl=US
------------------------
i hope i can get some help from your guys and thanks in advance ^^
up

Categories

Resources