Building My First Android App
Building My First Android App
So, I've finally done it - published my first Android app on the Play Store! It's called SpeakOut, and while it's not going to compete with Angry Birds or Instagram, it's taught me loads about the whole process of getting an app from idea to actual users' phones.
Why I Built SpeakOut
Look, every developer needs that first project to cut their teeth on. I wanted something:
- Simple enough to actually finish
- Useful enough to be worth publishing
- Complex enough to learn from
- Something I could test properly on real hardware
The Development Process
Setting Up
First off, got myself sorted with:
- Eclipse (yeah, Android Studio's out now but Eclipse + ADT still works fine)
- Android SDK (properly massive download)
- My trusty Samsung Galaxy S3 for testing
- Genymotion for virtual device testing
The Actual Code
public class MainActivity extends Activity { private TextToSpeech tts; private EditText inputText; private Button speakButton; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // ... rest of implementation } }
Kept it proper simple:
- Basic UI with EditText and Button
- TextToSpeech for the main functionality
- Error handling (learned this the hard way)
- Proper cleanup in onDestroy()
Testing Was... Interesting
Found out pretty quick that emulators aren't enough:
Virtual Testing
- Genymotion for different Android versions
- Testing different screen sizes
- Basic functionality checks
Real Hardware Testing
- My Galaxy S3 (Android 4.3)
- Mate's HTC One (Android 4.4)
- Found some proper weird bugs that didn't show up in emulator
- Text-to-speech engines behave different on different phones!
The Production Journey
Getting Ready for Play Store
- Sorted out the manifest file:
<manifest android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="19" /> <uses-permission android:name="android.permission.INTERNET" /> </manifest>
- Made a proper nice icon (harder than it sounds)
- Took screenshots (tried about 20 times to get them right)
- Wrote app description (rewrote it about 5 times)
Google Play Store Process
Right, this was proper interesting:
- Needed a developer account (£25 - not too bad)
- Had to sort out all the app details
- Content rating questionnaire
- Upload APK
- Wait nervously
Things I Learned
Development
- Start simple, seriously
- Test on real phones as soon as possible
- Don't ignore those lint warnings
- Logging is your best mate
- Back up your keystore file!
Publishing
- Screenshots are proper important
- Description needs proper keywords
- Price (free - let's be honest)
- Got to think about tablets too
- Need to plan for updates
The Patch Process
Had to push out a couple of updates already:
- Fixed a crash on some 2.3 devices
- Sorted out some text-to-speech engine issues
- Added better error messages
Learned that:
- Can't just push updates whenever
- Need to increment version numbers
- Changes take ages to show up sometimes
- Users actually update pretty quick
What's Next
Got a few ideas for improvements:
- Better UI (it's pretty basic right now)
- More language support
- Save favourite phrases
- Maybe add some widgets
- Proper Material Design (when I figure it out)
Tips If You're Starting Out
-
Start Small
- Don't try building the next Facebook
- Get something working first
- You can always add features later
-
Test Properly
- Get as many real devices as you can
- Don't trust the emulator completely
- Ask mates to try it
-
Publishing
- Read the guidelines properly
- Sort your privacy policy
- Keep your keystore safe
- Don't rush the store listing
Wrapping Up
Look, it's not the fanciest app out there, but it works, it's on the Play Store, and most importantly - I learned loads doing it. If you're thinking about making an app, just get stuck in. Start small, test properly, and don't worry if it's not perfect.
Check it out if you fancy: SpeakOut on Play Store