Run Android Apps on Your Windows PC

Embed Size (px)

Citation preview

  • 7/31/2019 Run Android Apps on Your Windows PC

    1/19

    Run Android Apps on Your Windows PC

    If youre not currently an Android phone user, you may be wondering what all the hoopla

    is about. Perhaps youve spent some time in the cell phone store at your local mall

    playing around with an Android phone, or maybe you got a few minutes with your

    friends phone before he snatched it back from you. But if you are truly intrigued by whatthe Android OS is all about, you can spend some quality time with it, at your leisure, in

    the comfort of your own homeand for free! All you need to do is download and install

    some free software, configure a few settings, and youll have a virtual Android phonerunning on your computer.

    To do this youll need to install and use the Android Software Development Kit (SDK),which is what developers use to create apps and utilities for the Android OS. Using an

    SDK might sound intimidatingand it can bebut if you stick to the basics and follow

    the instructions in this guide, youll find its relatively easy to use.

    First, a few caveats. First and perhaps most important, is that you wont be able to useyour virtual Android phone to actually make phone calls. This project is about getting a

    feel for the Android OS and its user interface, and the opportunity to explore someAndroid applicationswithout having to buy anything. Another limitation is that any app

    that seeks to utilize a phones camera or GPS will find that these components dont

    actually exist in the virtual device. Also, any app that uses location services (which

    provide relevant information based on your current physical location) wont be able topinpoint where you are. (It is possible to get a virtual Android device to work with an

    attached camera or GPS, but that sort of deep-developer-level tweaking is well out of the

    realm of what were doing here.) Youre also going to find that your virtual Androiddevice runs slowprobably much slower than a real Android phone would.

    But there are still plenty of things a virtual Android device can doespecially when you

    start installing apps (but of course, that comes with its own set of headaches, as we detail

    on the next page). If you have the patience to deal with the limitations and the curiosity to

    explore the Android OS, then read on for how you can have a virtual Android device upand running on your Windows PC in a matter of minutes.Next: A Few Words About

    Android Apps

  • 7/31/2019 Run Android Apps on Your Windows PC

    2/19

    Run Android Apps on Your Windows PC

    Bydbegunon July 9, 2010 at 12:01 am 22 Comments

    Share This article

    Youll want to keep in mind a few things about Android apps. Unlike the heavily policed

    iPhone App Store, the Android OS version, the Android Market, has much looserguidelines. In fact, some consider the Android Market to be the wild west of apps:

    Almost anything goes, and malicious apps are often pulled from the Android Market only

    after users complain. As to how widespread the potential is for malware in the Android

    Market, the mobile phone software security company, SMobile Systems, recentlyreleaseda report that estimates that one in every five applications request permissions toaccess private or sensitive information that an attacker could use for maliciouspurposes.

    Its unlikely that every single one of these apps is requesting this information

    intentionally for the purpose of sending it back to cybercrooks. In all probability, themajority of these apps are either using this information for legitimate purposes (such as

    Internet banking) or are just the by-product of developers sloppy coding. But at least

    some of these apps may be trying to steal your information and put it in the hands ofindividuals you probably would rather not have it.

    And the Android Market isnt even the only source for downloading and installingAndroid apps. A number of independent Android apps stores have already been doing

    business for a while now (such asSoftonic,Handango, andGetJar), and new ones are

    starting to pop up (such asAndSpot,SlideMe, andAndAppStore) now that the popularityof Android phones is increasing. How these independent sources will mind the

    cybergates still remains to be seen.

    The bottom line is that you need to be careful what you install on an Android deviceeven a virtual oneespecially if youve already entered some personal information, such

    as your Google account credentials. How do you know if an app is really malware in

    disguise? Without having some sort of security software installed, it might be hard to tell.I installed the no-costLookout Mobile Security FREE (beta) appon several of my virtual

    Android devices (and my real Android phone), and as far as I can tell, it does what it is

    supposed to: protect against malware.

    http://www.extremetech.com/author/dbegunhttp://www.extremetech.com/author/dbegunhttp://www.extremetech.com/author/dbegunhttp://www.extremetech.com/mobile/83812-run-android-apps-on-your-windows-pc-2#disqus_threadhttp://www.extremetech.com/mobile/83812-run-android-apps-on-your-windows-pc-2#disqus_threadhttp://threatcenter.smobilesystems.com/?p=1887http://threatcenter.smobilesystems.com/?p=1887http://en.softonic.com/phones/os-androidhttp://en.softonic.com/phones/os-androidhttp://en.softonic.com/phones/os-androidhttp://www.handango.com/catalog/SoftwareCatalog.jsp?categoryId=0&merch=recommendation_nodevice_androidhttp://www.handango.com/catalog/SoftwareCatalog.jsp?categoryId=0&merch=recommendation_nodevice_androidhttp://www.handango.com/catalog/SoftwareCatalog.jsp?categoryId=0&merch=recommendation_nodevice_androidhttp://www.getjar.com/http://www.getjar.com/http://www.getjar.com/http://andspot.com/http://andspot.com/http://andspot.com/http://slideme.org/http://slideme.org/http://slideme.org/http://andappstore.com/AndroidApplications/apps/%21indexhttp://andappstore.com/AndroidApplications/apps/%21indexhttp://andappstore.com/AndroidApplications/apps/%21indexhttps://www.mylookout.com/https://www.mylookout.com/https://www.mylookout.com/https://www.mylookout.com/http://andappstore.com/AndroidApplications/apps/%21indexhttp://slideme.org/http://andspot.com/http://www.getjar.com/http://www.handango.com/catalog/SoftwareCatalog.jsp?categoryId=0&merch=recommendation_nodevice_androidhttp://en.softonic.com/phones/os-androidhttp://threatcenter.smobilesystems.com/?p=1887http://www.extremetech.com/mobile/83812-run-android-apps-on-your-windows-pc-2#disqus_threadhttp://www.extremetech.com/author/dbegun
  • 7/31/2019 Run Android Apps on Your Windows PC

    3/19

  • 7/31/2019 Run Android Apps on Your Windows PC

    4/19

    All of the examples I provide here were done on a system running Windows 7; but theyshould be just as applicable for virtually any system running 32-bit Windows XP or 32-or 64-bit Windows Vista. There are even versions of the Android SDK that run on Intel-

    based Macs loaded with Mac OS X 10.5.8 and later and some versions of Linux, but the

    steps to getting this to work on these other operating systems differ somewhat from youll

    find in this guide.

    The first thing you need to do is to make sure that Java is installed on your system. If

    youre not sure, check out theofficial Java Websiteit will tell you if Java is installed

    and if so, which version. If you dont have Java installed or its an older version, follow

    the onscreen instructions for installing the latest version. The documentation for the

    Android SDK suggests that you install the JDK (Java Development Kit) version of Java;but unless you are a developer all you really need is the standard version of Java, which is

    officially called the Java SE Runtime Environmentif you are downloading it using

    Internet Explorer, it might be listed as Java for Windows Internet Explorer.

    Once you confirm that Java is properly installed, the next step is to download theAndroidSDK Starter Packageyoull be downloading a zip file. When you unzip it you shouldhave a folder called android-sdk-windows. You can put this folder anywhere you want on

    your computereverything runs out of this folder and there is no software to install in

    the traditional sense. Just remember where you put the folder, because no shortcuts or

    desktop icons get created unless you do so manually.

    Navigate to the android-sdk-windows folder and launch SDK Setup.exe, which is theAndroid SDK and AVD Manager application.

    If Java is not properly installed, an error message will pop up stating that Java cannot be

    found.

    http://www.java.com/en/download/installed.jsphttp://www.java.com/en/download/installed.jsphttp://developer.android.com/sdk/index.htmlhttp://developer.android.com/sdk/index.htmlhttp://developer.android.com/sdk/index.htmlhttp://openimagewindow%28%27image_popup/0,1740,iid=263536,00.asp',%20'871',%20'548')http://developer.android.com/sdk/index.htmlhttp://developer.android.com/sdk/index.htmlhttp://www.java.com/en/download/installed.jsp
  • 7/31/2019 Run Android Apps on Your Windows PC

    5/19

    If this is the first time youve run the Android SDK and AVD Manager, you might see aRefresh Sources window that says the repository cant be found. If you do, youll have tochange the SDKs settings to use HTTP, instead of the default HTTPS. To do this, click

    Close. Next youll see a Choose Packages to Install window, but with nothing listed.Click Cancel. The next window you should see is the Android SDK and AVD Manager

    window. Select the Settings tab and in the Misc section enable the

    Force https:// Sources to be fetched using http:// setting.

    Now select the Available Packages tab. You should see a single site in the list: https://dl-ssl.google.com/android/repository/repository.xml. Select this site and a list of packages

    should appear below it. If you want to play around with the different versions of the

    Android OS then enable all the packages.

    http://openimagewindow%28%27image_popup/0,1740,iid=263538,00.asp',%20'745',%20'433')http://openimagewindow%28%27image_popup/0,1740,iid=263537,00.asp',%20'480',%20'319')
  • 7/31/2019 Run Android Apps on Your Windows PC

    6/19

    If you only want to use Android 2.2, then the only packages youll need to download areDocumentation for Android SDK, API8, revision 1; SDK Platform Android 2.2,

    API8, revision 1; Samples for SDK API8, revision 1; and Google APIs by Google

    Inc., Android API8, revision 1.

    Once youve selected the packages you want to download, click the Install Selected

    button. This opens the Choose Packages to Install window, with all of the previouslyselected packages listed. (If you didnt encounter the HTTPS error when you first

    launched the SDK then this is the first screen you should see.) Dont hit the Install button

    quite yet. Youll notice that some of the listed packages have question marks next tothem. This means that you have to accept the license agreement for each of these

    packages before you can install them. Select each package that has a question mark next

    it and click the Accept button. Once all the packages have check marks next to them goahead and click the Install button.

    If you chose to install all of the available packages, it may take a few minutes todownload them all. When it is done, youll see a window that says something like Done,

    12 packages installed. Click Close.Next: Creating an Android Virtual Device

    http://openimagewindow%28%27image_popup/0,1740,iid=263541,00.asp',%20'740',%20'370')http://openimagewindow%28%27image_popup/0,1740,iid=263540,00.asp',%20'745',%20'433')
  • 7/31/2019 Run Android Apps on Your Windows PC

    7/19

    Now youre finally ready to create you very first virtual Android device! The AndroidSDK actually refers to this as an Android Virtual Device or AVDwhich is what I willbe calling it from here on out. Select the Virtual Devices tab and click on the New button.

    This opens a Create new Android Virtual Device (AVD) window. Theres actually notmuch to creating an AVD. All you really need to do are:

    Name. Give the AVD a name. Pretty much any name will do that uses alphanumeric

    characters.

    Target: Here is where you pick the version of the Android OS that the AVD will be

    based on. For this example, choose Android 2.2.

    SD Card Size:This is where you choose the size of the AVDs virtual SD card. The SDCard size must be at least 9MB. For this example, create a 1GB SD Card.

    Skin: You can choose any pre-defined (built-in) or custom resolution that you wantit

    doesnt have to match the resolution or aspect ratio of a real phone screen. For thisscenario, chosse WVGA800 (800480), which is the screen resolution of a number of

    phones, such as the HTC Incredible. If you wanted to, you could set a custom resolutionthat simulated what an Android tablet might look likeperhaps with a screen resolution

    of 1024600.

    Hardware:These items will be selected automatically. You dont need to make any

    additions or changes hereunless you are a developer and you know what you are doing.

    Now click the Create AVD button.

    http://openimagewindow%28%27image_popup/0,1740,iid=263542,00.asp',%20'745',%20'433')
  • 7/31/2019 Run Android Apps on Your Windows PC

    8/19

    The AVD will be created lickety-split, and a window will pop up stating that the AVDhas been created. Click OK to close the window. Note that once you create an AVD, its

    settings cant be changed. If want to make any changes, youll need to create a brand newAVD. The AVD you just created should now appear in the list of Virtual Devices.

    To launch the AVD, select it and then click the Start button. A Launch Options window

    opens, which allows you to Scale the display and Wipe user data. You might be temptedto choose the Scale display optionbut dont, because if you do, the resulting window

    will be the physical size of a phone screen (about only three inches tall). Dont select theWipe user data option either (though we will be using this option later when we set up the

    Android 1.6 AVD that includes the Android Market). Just click the Launch button to start

    the AVD.

    http://openimagewindow%28%27image_popup/0,1740,iid=263544,00.asp',%20'745',%20'433')http://openimagewindow%28%27image_popup/0,1740,iid=263543,00.asp',%20'410',%20'566')
  • 7/31/2019 Run Android Apps on Your Windows PC

    9/19

    It might take a couple of minutes for the AVD to launch; so be patient. But soon enough,the AVD will appear on your screen. The AVD is also referred to as an emulator because

    it emulates an Android device.

    Youll see a window on the left that is the devices display, and a window on the rightthat houses the devices navigation buttons and virtual keyboard. In most cases you

    seldom have to use the onscreen navigation buttons or keyboardyour systems real

    mouse and keyboard should do the trick.

    Here are some useful mappings to help you navigate in the AVD using your systemskeyboard:

    Home Go to the Home Screen

    F2 Menu Button

    http://openimagewindow%28%27image_popup/0,1740,iid=263546,00.asp',%20'1000',%20'625')
  • 7/31/2019 Run Android Apps on Your Windows PC

    10/19

    ESC Back Button

    F6 Toggle Trackball Mode

    Ctrl+F5 Increase Volume

    Ctrl+F6 Decrease Volume

    Ctrl+F11 Switch Between Portrait and Landscape Mode

    Alt+Enter Toggle Full-Screen Mode

    Before you start exploring, one of the first things you might want to do is confirm that the

    AVD has Internet access. Look in the status bar (running across the top of the AVDsdisplay screen) and determine if you see an icon that has four bars with the first two bars

    lit up. If so, then the AVD at least thinks it has Internet access. You can confirm that the

    AVDs Internet access works by clicking on the Web browser icon in the bottom panel ofthe home screenthis is the icon that looks like a globeand seeing if it connects to the

    Internet.

    The AVD is simply piggybacking off ofyour systems Internet connection. While

    experimenting with the Android SDK on a number of different systems, I encountered a

    few situations where an AVDs Internet connection did not work. In all of theseinstances, the system was connected to the Internet via an Ethernet cable; but the system

    also had a Wi-Fi radio that wasnt connected to an access point. Connecting the systems

    Wi-Fi radio to an access point and restarting the AVD resolved the Internet access issuefor me.

    If you click the Launcher icon (the icon that is made up of 44 squares), youll see the

    apps that come preinstalled in the AVD. Youre likely going to be disappointedthere

    arent many apps here at all. But fret not; in the next section I explain how to installAndroid apps onto your AVD.

  • 7/31/2019 Run Android Apps on Your Windows PC

    11/19

    But before we discuss installing apps, a few words on quitting and starting an AVD.

    Quitting an AVD is as simple as just closing the window. Really. Thats all there is to it.

    As to starting an existing AVD, there are a number of different ways to this. One is tolaunch the Android SDK and AVD Manager (SDK Setup.exe) application, and then start

    the AVD from the Virtual Devices tab. But if youre going to be using the same AVD ona regular basis, heres how you can create a shortcut for it, so you can launch the AVD

    directly from your desktop:

    1. Determine the exact name of the AVD you want the shortcut to launch. You can getthis info either from the Android SDK and AVD Manager or from the physical location

    where the AVDs are saved, which is C:Users[username].androidavd

    2. Create a new desktop shortcut for the emulator.exe file that resides in the android-

    sdk-windows/tools folder.

    3. Once youve created the shortcut, edit its properties and add these options to the end of

    the target text field: -avd [name-of-avd]. This isnt case-sensitive, so you can do it all in

    lowercase. For my example, the shortcuts full target text field reads as follows:

    c:android-sdk-windowstoolsemulator.exe avd extremetech-froyo

    http://openimagewindow%28%27image_popup/0,1740,iid=263561,00.asp',%20'800',%20'739')
  • 7/31/2019 Run Android Apps on Your Windows PC

    12/19

    Now whenever you want to launch the AVD, all you have to do is double-click theshortcut.Next: Installing Apps From Independent Android Apps Stores

    http://openimagewindow%28%27image_popup/0,1740,iid=263562,00.asp',%20'386',%20'533')
  • 7/31/2019 Run Android Apps on Your Windows PC

    13/19

    If youve followed these instructions up to this point, youve got an AVD runningAndroid 2.2, with a few barely useful apps and no Android Market. So how are yougoing to get apps onto your AVD? By downloading them from one of the independent

    Android apps stores.

    Using your computers Web browser, navigate to one of the Android apps stores, such asSoftonic,Handango, orGetJar). Find the apps you want to download and click the

    respective download buttons for those apps.

    Android apps exist in files that have the APK (Android Package) file extension. An APK

    file is actually a package that contains a number of bundled componentssimilar to how

    a zip file works. In fact, when you download an Android app file, it might have either anAPK or ZIP file extension. If you download an Android app that has a ZIP extension,

    dont try to unzip itjust change the ZIP extension to APK.

    So how do you install an Android app that youve downloaded onto your computers hard

    drive? The first thing you need to do is fire up the AVD and wait for it to launch. Oncethe AVD is running, make sure that its set to permit the installation of non-Market

    applications. Do this by selecting the Launcher icon, choose the Settings icon, click on

    Applications, and make sure that Unknown sources is enabled.

    With the AVD running, open a Windows Command-Prompt window (or what we old-schoolers like to call a DOS-Prompt window). Youll be typing a command that executesthe adb.exe application that lives in the android-sdk-windows/tools folder, followed by a

    space, then the word install, another space, and then the Android apps file name. Thetrick is, you also need to include the full paths for both the adb.exe app and the APK file

    you are installing (unless they both live in the same folder).

    http://en.softonic.com/phones/os-androidhttp://en.softonic.com/phones/os-androidhttp://www.handango.com/catalog/SoftwareCatalog.jsp?categoryId=0&merch=recommendation_nodevice_androidhttp://www.handango.com/catalog/SoftwareCatalog.jsp?categoryId=0&merch=recommendation_nodevice_androidhttp://www.handango.com/catalog/SoftwareCatalog.jsp?categoryId=0&merch=recommendation_nodevice_androidhttp://www.getjar.com/http://www.getjar.com/http://www.getjar.com/http://openimagewindow%28%27image_popup/0,1740,iid=263563,00.asp',%20'966',%20'892')http://www.getjar.com/http://www.handango.com/catalog/SoftwareCatalog.jsp?categoryId=0&merch=recommendation_nodevice_androidhttp://en.softonic.com/phones/os-android
  • 7/31/2019 Run Android Apps on Your Windows PC

    14/19

    Heres an example of how I installed the Word Search app in my AVD:

    c:android-sdk-windowstoolsadb.exe install c:tempwordsearch.apk

    It might take a few moments to install. When the word Success appears in theCommand Prompt window, you know it has installed. Ive found that on rare occasions,

    installation will fail on the first try, but succeed on a second attempt.

    Now if you go back to the AVD, you should see an icon for the app you just installed

    appear amongst the other apps. Launch the app and it should run as expected.

    If you want to uninstall an app, do so by going to Settings > Applications > ManageApplications > Downloaded, then select the application you want to delete, and click the

    Uninstall button.

    http://openimagewindow%28%27image_popup/0,1740,iid=263565,00.asp',%20'800',%20'369')http://openimagewindow%28%27image_popup/0,1740,iid=263564,00.asp',%20'837',%20'366')
  • 7/31/2019 Run Android Apps on Your Windows PC

    15/19

    If the AVD actually had access to the Android Market, then there would be a bevy ofUninstall applications to choose fromwhich would make uninstalling apps a much

    easier task. I didnt have much luck finding a working uninstall app from the independentAndroid apps stores.Next: Accessing the Android Market in an AVD

    http://openimagewindow%28%27image_popup/0,1740,iid=263566,00.asp',%20'966',%20'892')
  • 7/31/2019 Run Android Apps on Your Windows PC

    16/19

    If you want to be able to access the Android Market in an AVD, you can do it; but it willneed to be with an older version of the Android OS. A software Engineer by the name ofKumar Bibek postedinstructions on his blog; on how to do this using a file downloaded

    from the HTC Developer Center Website with an Android 1.6 AVD. While some users

    claimed it worked for them, I couldnt get it to work. But luckily, Mr. Bibek made an

    alternative custom file available for download that worked for me. Heres what you needto do:

    1. Create an AVD that uses Android 1.6but dont start it yet.

    2.Download the system.img file that Mr. Bibek made available here.

    3. Copy the system.img file you just downloaded to the AVD folder for the AVD you just

    created. You can find this folder in .androidavd in your user folder. For example, Icreated an AVD called Market and this is the path to its folder on my system:

    C:UsersExtremeTech.androidavdMarket.avd

    http://tech-droid.blogspot.com/2009/11/android-market-on-emulator.htmlhttp://tech-droid.blogspot.com/2009/11/android-market-on-emulator.htmlhttp://tech-droid.blogspot.com/2009/11/android-market-on-emulator.htmlhttp://www.4shared.com/file/165624746/fc72c3ed/system.htmlhttp://www.4shared.com/file/165624746/fc72c3ed/system.htmlhttp://www.4shared.com/file/165624746/fc72c3ed/system.htmlhttp://openimagewindow%28%27image_popup/0,1740,iid=263568,00.asp',%20'923',%20'353')http://openimagewindow%28%27image_popup/0,1740,iid=263567,00.asp',%20'410',%20'566')http://www.4shared.com/file/165624746/fc72c3ed/system.htmlhttp://tech-droid.blogspot.com/2009/11/android-market-on-emulator.html
  • 7/31/2019 Run Android Apps on Your Windows PC

    17/19

  • 7/31/2019 Run Android Apps on Your Windows PC

    18/19

    7. Before you can access the Android Market youll have to either create a Googleaccount or enter the login credentials for an existing Google account.

    8. Once your Google account credentials are entered, you can access the Android Marketand start downloading apps into the AVD!

    http://openimagewindow%28%27image_popup/0,1740,iid=263571,00.asp',%20'800',%20'783')http://openimagewindow%28%27image_popup/0,1740,iid=263570,00.asp',%20'966',%20'946')
  • 7/31/2019 Run Android Apps on Your Windows PC

    19/19

    Have fun exploring Android and the rapidly growing world of Android apps!

    http://openimagewindow%28%27image_popup/0,1740,iid=263572,00.asp',%20'966',%20'946')