Question Get Exact Name from *.apk Files

chaoszero6

New member
Joined
Jun 13, 2011
Messages
4
Location
Chennai, Tamil Nadu, India
Programming Experience
3-5
hi, i would like to make an application in VB.NET and in that i have to display the Exact Name of an apk application in the ListView with Icons.

im having some list of applications in application.startuppath & "\apps_android" folder and this folder contains files like com.alienmanfc6.wheresmyandroid.apk but i need to make get the Name of the Application like Where's My Droid? and display it in the ListView1 and it must also extract the icons from the apk file and show the icon in ListView1

is it possible using vb.net???
if so plz send me the code. really need it urgent..
 
Decompile the apk file, for example using this tool: android-apktool - A tool for reengineering Android apk files - Google Project Hosting
Then according to The AndroidManifest.xml File | Android Developers there is a AndroidManifest.xml in root, which has an application node with a label attribute for it's name.
<application> | Android Developers says this name should point to a string resource, which seems to be in strings.xml in res/values folder.
Similar the application node in manifest has an icon attribute pointing to a drawable image resource.
The XmlDocument class may be used to read from xml documents in VB.
 
Android development is Java based and I doubt you will find any other approach than automating a command line process for a Java app. The tool I linked to also includes aapt.exe (Android Asset Packaging Tool) which can dump information about the apk, for example the badging information includes the application name and path to icon resource. A sample of such a string line can be as below, and notice resource strings here conveniently come out decoded:
application: label='Unit Converter' icon='res/drawable-hdpi/robot_launcher.png'
With Process class you can in milliseconds get and parse that information from the string.
Since apk is basically a zip file, using a zip library you can then extract only the icon image file. This file exists in the compressed package in 'plain', unlike the xml and string resources mentioned before.
 
thankz bro, will try that. :D
and by the way, i saw that in Droid Explorer which is a .Net Application
when i connect my phone and open droid explorer, it shows all files in my sdcard and the all *.apk files with their app_name
thats y i thought to develop in .Net
 
and by the way, i saw that in Droid Explorer which is a .Net Application
That is not the same, that is interacting with the device, apparently through an application that has to run on the device.
 
hi bro, ive found the way to get the application name using aapt.exe as shown below.
D:\Android\android-sdk-windows\platform-tools>aapt dump badging Datas/ant.apk
package: name='com.bestcoolfungames.antsmasher' versionCode='25' versionName='2.
1.13'
application-label:'Ant Smasher'
application-icon-120:'res/drawable-ldpi/icon.png'
application-icon-160:'res/drawable-mdpi/icon.png'
application-icon-240:'res/drawable-hdpi/icon.png'
application: label='Ant Smasher' icon='res/drawable-mdpi/icon.png'
launchable-activity: name='com.bestcoolfungames.antsmasher.initialView' label='
Ant Smasher' icon=''
uses-permission:'android.permission.VIBRATE'
uses-permission:'android.permission.INTERNET'
uses-permission:'android.permission.ACCESS_NETWORK_STATE'
uses-permission:'android.permission.READ_PHONE_STATE'
uses-permission:'android.permission.GET_TASKS'
uses-permission:'android.permission.GET_ACCOUNTS'
uses-permission:'com.android.vending.BILLING'
i have to display the returned string in TextBox1.
can you say me how to get the returned strings from console to vb.net->Form1->TextBox1????
thank you.

this code runs the command but cant get the returned string or error message that is displayed while running in the console.

VB.NET:
Dim p As New ProcessStartInfo
        p.FileName = "D:\Android\android-sdk-windows\platform-tools\aapt.exe"
        p.Arguments = "dump badging Datas/ant.apk"
        p.WindowStyle = ProcessWindowStyle.Maximized
        Process.Start(p)
 
Back
Top