GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
01/09/15 01:22 AM (9 years ago)

Fifteen Minute Video Tutorial: Android Studio + Buzztouch APK Compile

Hello! This fifteen minute tutorial shows how to take a Buzztouch v3 project package, import it into Android Studio, link the Google Play Services Library, generate a debug keystore, and create an apk file that you can load onto your Android device. Lots of you have been asking how to do this, so I figured I'd nail it down and make a video. This tutorial is based on the latest RC (Release Candidate) version of Android Studio. You can find that here: http://developer.android.com/sdk/index.html When the video is done uploading (in about an hour...I have a slow connection), it will be found here: http://youtu.be/LsLTfaajeqg Finally, here are the basic steps that the video covers: 1. Download project package. Ensure plugins are either Android only or Android and iOS. No iOS only plugins! 2. Extract (unzip) the project contents. 3. Fire up Android Studio. 4. Select 'Import Non Android Studio Project'. 5. Select the 'Import Destination Directory'. Choosing the default is a good idea. 6. Deselect : - Replace jars with dependencies, when possible - Replace library sources with dependencies, when possible 7. Get a cup of coffee because it's gonna take a few minutes. 8. Once it's done importing, you're likely to see an error related to this: - android:value="@integer/google_play_services_version" /> That's because we haven't imported the Google Play Services yet 9. Check the Android SDK Manager to ensure you have downloaded the Google Play Services. If you haven't, do so now. Also make sure you have the Android 4.0 API installed as well. 10. To import the Google Play Services, do the following: - Highlight your app (likely called app) - Go to File > Project Structure - Click on the App under Modules - Click on the Dependencies Tab - Near the botton left, hit the + button - Select Library Dependency - Select Google Play Services, then hit OK This will resync your project, and the two errors should go away 11. To build the apk, go to Build > Generate Signed APK from the menu bar 12. Click the App module, then hit Next 13. Create a debug keystore if you don't already have one. If you do, navigate to it, and provide the password 14. Enter the master password for the master password database 15. Select the destination folder, and change the Build Type to Debug 16. Hit Finish 17. Celebrate when it finishes! Give a big sigh if you hit an error, and try to work it out. Enjoy! Please don't hesitate to provide constructive criticism if you have any! Mark
 
Bytewizard
buzztouch Evangelist
Profile
Posts: 32
Reg: Jul 04, 2011
Manila, Philipp...
1,020
like
01/09/15 03:38 AM (9 years ago)
Great! Thank you very much, Mark! Will probably do this. :)
 
rburns50
buzztouch Evangelist
Profile
Posts: 168
Reg: May 12, 2014
Bilston - Engla...
9,130
like
01/09/15 03:52 AM (9 years ago)
Excellent video Mark thank you - my appetite now wet for Studio testing!!!!
 
Bytewizard
buzztouch Evangelist
Profile
Posts: 32
Reg: Jul 04, 2011
Manila, Philipp...
1,020
like
01/09/15 04:11 AM (9 years ago)
Great! Thank you very much, Mark! Will probably do this. :)
 
Bytewizard
buzztouch Evangelist
Profile
Posts: 32
Reg: Jul 04, 2011
Manila, Philipp...
1,020
like
01/09/15 05:45 AM (9 years ago)
Sorry for the double posting.
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
01/09/15 06:21 AM (9 years ago)
Thanks Mark.
 
Calypso Kid
Aspiring developer
Profile
Posts: 780
Reg: Mar 09, 2012
Upstate New Yor...
18,200
like
01/09/15 08:49 AM (9 years ago)
Thank you Mark ! Dave
 
MacApple
Apple Fan
Profile
Posts: 4675
Reg: Oct 25, 2010
USA
61,150
like
01/09/15 12:02 PM (9 years ago)
Rock star!
 
Tony @ Buzztouch
buzztouch Evangelist
Profile
Posts: 528
Reg: Mar 05, 2011
Saint Louis, Mi...
24,620
like
01/09/15 09:10 PM (9 years ago)
Well done master of the Android world!!! Tony
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/09/15 09:20 PM (9 years ago)
Thanks, everybody! Hope it was helpful! Mark
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
01/10/15 12:15 AM (9 years ago)
Thank you, Mark! This is awesome.
 
aquila198
buzztouch Evangelist
Profile
Posts: 473
Reg: Jul 22, 2011
location unknow...
10,330
like
01/10/15 01:30 PM (9 years ago)
outstanding! Thank you Mark!
 
chadh0130
Apple Fan
Profile
Posts: 352
Reg: Nov 05, 2011
Rhode Island
4,020
like
01/10/15 04:58 PM (9 years ago)
Awesome tutorial. First time using Android Studio, ran into a few errors when attempting to create an APK using the CR login menu. Once I sort those out, I'll at least know how to create apk using AS. Thanks, Mark!
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/10/15 05:15 PM (9 years ago)
I had a few issues with Chris' plugins as well. So, for the purposes of the tutorial, I just deleted them. I hope you get it worked out! Mark
 
Arubaman
Aspiring developer
Profile
Posts: 636
Reg: Oct 20, 2011
Akron
16,910
like
01/10/15 11:02 PM (9 years ago)
Nice instructive video, well done, thanks.
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
01/11/15 04:33 AM (9 years ago)
Thank you my good man! Great tutorial. I just setup a few projects in Android Studio and won't be going back (auto loading imports is just awesome. Adding jar's is a different matter!) On the whole, so much better. Cheers Darrel
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
01/11/15 07:59 AM (9 years ago)
Excellent Mark! And I still use ur ADT videos too everytime i need to reinstall eclipse. Which is way too often. Thanks:)
 
Tyroner
Aspiring developer
Profile
Posts: 175
Reg: Dec 26, 2012
Johannesburg, S...
4,200
like
01/17/15 11:08 PM (9 years ago)
Hi Mark. This is excellent! I finally managed to get my app running in the simulator! Find it better then Eclipse. Thanks for this! 2 issues: 1. My images do not show up in the app on the simulator. I copied it into the Docs folder under Assets but it does not show. 2. How do i get to see the maps? I am using the location maps plugin. Thanks Tyrone
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/18/15 12:00 AM (9 years ago)
Hi Tyrone, Images, unless they are tied to an HTML document, go in the res > drawable folders. In Eclipse, maps were not working in the emulators. I haven't tried it with Studio yet...I'll give that a go next week, and whip up a video in the event that they work. I'm assuming you have your Google Maps for Android API key and all that stuff? Mark
 
Tyroner
Aspiring developer
Profile
Posts: 175
Reg: Dec 26, 2012
Johannesburg, S...
4,200
like
01/18/15 12:22 AM (9 years ago)
I tried dragging it into the drawable folder but it will not accept it. Also tried the other way where it gets dragged in via Finder and then to refresh the project in Studio but there is no refresh option under File in Android studio. Will check out how to generate the Google maps for Android API key. Thanks
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/18/15 12:50 AM (9 years ago)
Hi Tyrone, Yeah, it's kinda weird in Studio. Keep in mind that it makes a copy of your project and stores it, by default, in the AndroidStudioProject folders. Where that's located depends on your OS. I was able to copy an image from my res > drawable folder in the original source folders, then go into Studio, hightlight the res > drawable folder, and hit Paste. That put it in my Studio project. There is a "Synchronize" option in the menu, but it doesn't work the way I expect it to. I'm still investigating. Check this tutorial out from @SmugWimp on how to get the API stuff: https://www.buzztouch.com/files/howtos/googleapiv2.pdf Mark
 
Tyroner
Aspiring developer
Profile
Posts: 175
Reg: Dec 26, 2012
Johannesburg, S...
4,200
like
01/18/15 02:55 AM (9 years ago)
Thanks Mark that worked! It will not copy a folder containing the images but only the actual image files.
 
QC
Aspiring developer
Profile
Posts: 50
Reg: Apr 20, 2013
Milwaukee, WI
6,650
like
01/23/15 05:27 PM (9 years ago)
Loved the step by step got my app to compile. Haven't gotten it to run on the emulator yet. Haven't quite figured out the steps to get the apk to load and to run on a device. Keep getting further
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/24/15 08:42 PM (9 years ago)
Hi @QC, If you connect your device to Android Studio, you can export it directly to your device, and it will do the installation. Otherwise, if you have an apk created already, all you need to do is either email it to yourself, and then tap on the attachment, or put it somewhere like DropBox, and tap on the file. That will start the install process. Let me know if you still have troubles! Mark
 
appsolutely
Aspiring developer
Profile
Posts: 72
Reg: Jan 05, 2011
UK
10,070
like
01/26/15 10:36 AM (9 years ago)
Thanks @GoNorthWest for this great tutorial, I've managed to compile and publish a new app with Android Studio! I find both the software and the emulator much quicker than eclipse.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/26/15 10:57 AM (9 years ago)
Sweet, @appsolutely! I think I tend to agree with you about the speed! Mark
 
appsolutely
Aspiring developer
Profile
Posts: 72
Reg: Jan 05, 2011
UK
10,070
like
01/26/15 11:03 AM (9 years ago)
If anyone is interested in the steps to compile for release, let me know and I will type them up and post on here.
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
01/29/15 02:57 PM (9 years ago)
Thanks @GoNorthWest for this great tutorial, got my 1st android app compiled 1st try. One issue, have you gotten the Location Map plugin working on Android Studio yet? I've double checked I had it selected, along with several others, and for some reason, when I run the Android app on my device, it keeps telling me the Plugin is missing when I try to load my Map which uses a data URL. Went through this twice. I've already got my Google GCM project number and Google Maps API V2 API in the Manifest file. I'll start a list of plugins I have working later tonight. Same location map plugin, same dataURL, etc are working and published on the IOS version already. thanks - ronnie
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/29/15 03:35 PM (9 years ago)
I haven't tried using it with Studio yet. Is there anything that shows up in LogCat when you try to load the screen? That would be helpful for debug. Mark
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
01/31/15 11:48 AM (9 years ago)
LogCat is my new friend! I watched your LogCat video, and immediately saw my issue. LogCat showed that Public Key for Android Application did not contain my new SHA1_key;application_name. I went https://console.developers.google.com to add in the new SHA1_key;application_name from the error in LogCat, and clean, build and the Location Map is now working!! All the steps to get Google maps working under Android are here (and it was just updated in Jan, 2015): https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2 All in all, Android Builder has been much easier than Eclipse for me. I'm in the journey of writing one of my IOS apps over to android, and had hit the wall with Eclipse about 5 months ago. Your two new Android Studio videos have made this so much easier. For you IOS'ers who want to try your first Android app....stop what your're doing and watch these videos! thanks mucho, ronnie
 
RonBo
buzztouch Evangelist
Profile
Posts: 167
Reg: Feb 26, 2012
Raleigh, NC
5,220
like
01/31/15 12:41 PM (9 years ago)
@absolutely - I would be interested in the compile steps for release. If you have something i would be happy to try them, should have this about ready to use for release in a couple of weeks.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
01/31/15 02:40 PM (9 years ago)
If you guys can wait until early next week, I plan on doing a video that covers how to do a release vs. debug. Mark
 
appsolutely
Aspiring developer
Profile
Posts: 72
Reg: Jan 05, 2011
UK
10,070
like
02/05/15 09:46 AM (9 years ago)
Sorry for the delay, I've had a busy few days and a bit of flu. Having looked this over in more detail, for a basic app all I have done in addition to GoNorthWest's notes at the top is... in the AnroidManifest.xml Remove:- android:debuggable="true" Make sure you retain the > Use a "Release" keystore Leave the Build Type as is There are other things to do to make the app function better, get maps working and install to the SD card etc. but just to get a release build that appears to be the only differences. Hope this helps in the meantime.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.