A collection of what I find useful in our Android class. Feel free to leave comments. Thanks…
adb (Android Debug Bridge) – Installing APK to AVD (Android Virtual Device) | ^ Go top
Alternative adb install:
- Load an AVD
- Goto Eclipse ADT folder, “sdk\platform-tools”
- Copy APK file(s) to this folder
- Open “Command prompt window” in said sub-folder
- Issue following command (see below screenshot):
adb install xyz.apk
adb -s emulator-XXXX install abc.apk
I copy & paste long filename from Explorer to DOS prompt
- Get back to AVD and run the installed APK
Suggest to keep “Scale display to real size” unchecked to have bigger pic, not easy to find many icons
- Other Alternatives:Dropbox:
The idea is to download directly to AVD from assessment’s APK link.
Advantage is not needing downloading/installing to PC environment.
Yet to test.
Succeeded in downloading the APK to AVD but wasn’t able to install yet.
Suspected that APK is corrupted, might retry.
To use this, need to first login to the class as link is https.
I guess security would only allow valid account to access APK link.
My first direct try failed to download without logging in.
aapt (Android Asset Packaging Tool) – Check APKs permission | ^ Go top
I have created a thread about aapt and adb, available in this thread:
To check for permission as in above screenshot:
aapt d permissions xyz.apk
Checking permission could also be done through the AVD.
Go to [Apps], [Settings], [Apps] and select app to check.
On “App Info”, scroll down check if there’s any “PERMISSIONS”.
Android App’s Workflow (My understanding so far) | ^ Go top
- Manifest.xml is read by installer, icon(s) added accordingly to Android’s HOME.
Each “LAUNCHER” category in manifest creates an icon in HOME.
- Icon launches the app according to specified “<activity android:name…>”, by default named MainActivity (a Java file).
- MainActivity as specified in its setContentView, loads layout (by default “activity_main”, an XML file).
- Layout is displayed on the device and control goes back to MainActivity class .
avd (Android Virtual Devices) | ^ Go top
- To change orientation from/to portrait/landcape, use [Ctrl]+[F12]
- To scroll, use drag and drop (Home/Apps screens scroll only horizontally)
Apps screen is alphabetical and can’t be re-arranged
- To enable screen capture, activate “Snapshot” and “Save to snapshot” options
Eclipse String Refactor | ^ Go top
Convert hardcoded string into XML value.
Eclipse Preview All Screen | ^ Go top
To see layout in all screen sizes
Eclipse Import Android Project | ^ Go top
To import copied/zipped Android project:
- From Eclipse, select “File”, “Import…”
- From Import dialog, select “General”, “Existing Projects into Workspace”
- Click [Browse] from “Select root directory”
- Click the folder that contains the “AndroidManifest.xml” and click the [OK] button
- Back to the “Import” dialog, click the [Finish] button and the project will be added.
DOS Scroll Tab – On DOS Prompt, after a command and space, press [Tab] to view subfolders. | ^ Go top
DOS Prompt from Explorer | ^ Go top
To open command prompt window in the active folder, in Windows Explorer press [Shift]+[Right-Click]
Intel HAXM – Hardware Accelerated Execution Manager | ^ Go top
DOS Commands: sc query intelhaxm, sc stop intelhaxm, sc start intelhaxm
Uninstallation: Run the file and activate the “Remove” option
Installation: Run the latest HAXM file that is the hotfix
Hotfix is a new install that’s neither just an add-on nor an update
The latest version as of this writing is 1.0.7:
Self Evaluation | ^ Go top
This is new to me, hardly noticed this.
Was surprised to see I was able to grade myself when [Go on to self-evaluation] was clicked.
Hardware Connection | ^ Go top
Connecting mobile device to Eclipse:
- Activate USB Debugging
- Load Eclipse and select PC Software
PhoneGap | ^ Go top
Eclipse Run Config | ^ Go top
I once imported an Android project that automatically launches AVD. Not knowing Run Config that time, I thought there’s something wrong. Came across an ebook showing Run Config. In short, you can simply assign following to be automatically run from Android project:
- Activity (Wondering what happens when this conflicts with the project itself)
- Target AVD/Mobile Device
Eclipse Project Naming | ^ Go top
Activity, Layout, Menu have naming convention. For the above sample, menu would be main.xml.
- Activity Name: OtherActivity
- Layout Name: activity_other
- Menu Name: other
Clean and beautiful ads: