As of late 2021, we are in the process of updating Stencylpedia and fixing up outdated & broken content. Thanks for your patience!

115,730

Views

Beginner

Level

32

Comments

Getting Started with Android

by Jon (Updated on 2015-10-23)


Contents

  • Requirements
  • Is there an Android "simulator"?
  • Walkthrough
    • Step 1: Set up your Device
    • Step 2: Install the Java JDK
    • Step 3: Install the Rest
    • Step 4: Test on Device
  • Troubleshooting
  • FAQ

System Requirements

To test and publish to Android, you need the following.

  • An Android device with Gingerbread (2.3) or better (4.0 or better strongly recommended)
  • A USB cable to connect your device to your computer
  • Java Development Kit 1.6 (JDK 1.6) or later

The rest of the software requirements are fetched by Stencyl directly from Google's servers.

Is there an Android "simulator"?

No emulator or simulator is available for testing Android games on your computer.

If you don’t have an Android device, we recommend picking up a cheap one, such as a Moto E or Moto G. We do not recommend purchasing off-brand devices since you may be unable to test your games on them

Step 1: Set up your Device

If you haven’t tested apps on your device before, you’ll need to do a few things to it before you begin.

Install a USB Driver

For some devices, especially those made by Samsung, a USB driver (called an OEM USB Driver) has to be installed for your PC/Mac to recognize your device.

Google maintains a page that lists all of these devices out.

Turn on USB Debugging

USB Debugging must be enabled, otherwise your device will be unable to communicate with your computer. The location of this option varies depending on what version of Android and what device you have.

Do a Google search for USB debugging [YOUR_DEVICE_HERE]

Turn on USB Mass Storage

If you don't turn off USB Mass Storage, your device will be treated like a USB flash drive, rather than a proper Android device. Again, the location of this option varies depending on what version of Android and what device you have.

One trick that sometimes works is to plug your device in - if you're lucky, your device will ask you whether you want to Turn off USB Mass Storage.

Do a Google search for USB Mass Storage [YOUR_DEVICE_HERE]

Step 2: Install the Java JDK

Android requires the Java JDK (Java Development Kit), version 1.6 or later, in order to build and sign apps. You must install this on your own, although Stencyl will make a best effort to flag this if you don’t have it installed.

Step 3: Install the Rest

The rest of the requirements (the Android SDK) are automatically downloaded by Stencyl. This is triggered when you attempt to run an Android app for the first time.

  • Plug in your Android device to your computer. Turn it on (or take out of sleep mode).
  • Switch the Platform dropdown's value to Android.
  • Click Test Game.

If all goes well, you'll see Stencyl download all of the required packages. This takes a while due to the large file sizes.

Step 4: Test on your Device

After the Android packages finish downloading, Stencyl may ask you to reboot. If it requests that, do that, reopen the game and then run the game again.

  • Plug in your Android device to your computer. Turn it on (or take out of sleep mode).
  • Switch the Platform dropdown's value to Android.
  • Click Test Game.

If all goes well, your game will build for a while and then finally launch the app directly on your device.

Tip: Monitor the Log Viewer (View > Log Viewer) to track the progress of your game's build. The first build will take some time depending on how fast your computer is.

Troubleshooting

While downloading the Android SDK in Step 3, the download stops. None of my apps run - how can I reset the installation process?

Go to the following location in the main menu: Debug > Android > Reinstall Android SDK

My game doesn't launch on my device. It gets stuck at "Sending to Device"

The good news is that if you get this far, it's out of Stencyl's hands - the Android SDK is in control at this point. Failure to launch usuall indicates a hardware / operating system issue. Here are some common causes.

  • Make sure the device is plugged in.
  • Make sure the device is turned on (not asleep).
  • Enable USB Debugging on the device.
  • Turn off USB Mass Storage.
  • Install the driver for your device. See: http://developer.android.com/tools/extras/oem-usb.html
  • Unplug and replug the USB cable, particularly if your computer or the device went to sleep.

If you continue to have issues, view our forum discussion for additional ideas.

My game crashes immediately on the device.

  • Create a blank, one-scene game and run that on your device. If this crashes too, ask for help on the forums.
  • If that blank games works fine, run your game on the Windows/Mac/Linux target and see if it crashes there.
  • If it crashes, try one last time on Flash. If it crashes, you are (relatively) lucky since you now have logs that are readable. Ask for help on the forums.

My game crashes immediately on a Samsung Galaxy (anything recent)

Enable 3x scale for your game since the flagship Galaxy line requires this scale. This change has to be done in two places.

  • Settings > Settings > Advanced > Project Scales
  • Settings > Mobile > Display > Scales

FAQ

Can I use an existing / external install of the Android SDK?

Not at this time. We'd like to support this in the future.

How do I view the official device logs outside of Stencyl?

Use Device Monitor, which can be launched from Stencyl (under Debug > Android > Launch Device Monitor).

What version of the Android SDK does Stencyl use?

As of late 2015, we're up to API Level 22 (Lollipop).

Print Article Edit Article How to Edit an Article
Disclaimer: Use comments to provide feedback and point out issues with the article (typo, wrong info, etc.). If you're seeking help for your game, please ask a question on the forums. Thanks!

32 Comments

ManlyMouse
Are these steps still up to date for May 2014?
0 10 years, 4 months ago
Saksham
i have already got android sdk how can i install it manually to develope android games in stencyl i dont want to download it again pls help.......
1 10 years, 5 months ago
Jezus101
Those links are outdated, well the Linux one is, can we get a new link? or support for Java 7?
0 10 years, 6 months ago
sxr891
everything is setup according to the above, but stencyl logs state waiting on device for over 20 minutes.. any suggestions?
0 10 years, 6 months ago
TBS
JCC, apparently I didn't have Stencyl 3.0 (I just downloaded Stencyl 2.0 two weeks ago, so I thought I had the most up to date version; nope!). I can test on Android and Windows with 3.0, but there's no option for IOS, though I'm sure that won't effect you much, :)
0 10 years, 6 months ago
JCCJonesComm
Im having the same problem as TBS, anyone knows how to test on Android with the free Version? It clearly says that you can do so on the site, you just cant publish them. Or do you have to have the pro-version to even test?
0 10 years, 6 months ago
TBS
Ok, I really need some help. I have the free version of Stencyl, and I want to test my game on one of my android phones. When I open my game on Stencyl and go to the 'Platform' pulldown, the only available options are Flash (player and browser). It won't let me test the game on Android, IOS, Windows or anything else that is SUPPOSE to be in the pulldown.

I downloaded the JDK : http://www.oracle.com/technetwork/j ava/javase/downloads/jdk7-downloads -1880260.html (Windows x64 version). And I still can't test my game on Android. I made sure that when I created the game it was for Mobile.

1 10 years, 6 months ago
miltonmendieta
I have no idea how to do this for Mac Os X Mavericks. It's the most current mac OS. The instrcutions to the link posted for Mac is way out of date to find the JDK.
0 10 years, 6 months ago
WilliamScheffer
this is only for 3.0?
0 10 years, 6 months ago
jryans10
Hello,

What happens under "USB PC Connection" when you can only select 1 from the following list:

Media Device (MTP)
Camera (PTP)

You have to select one, so do I have to just select Camera?

Thanks!

2 10 years, 7 months ago

Sign In to Comment