I started working on simple Kids applications for my first real trial out of a desire to create some games. I wanted to create a mad libs application that would take in multiple inputs and read back a neat little story for kids.
This was where I actually made one of my first mistakes, and it eventually led me to one of my largest breakthroughs in working with apps. I saved everything in session. The session is nifty and helpful and can keep an application running with cool dialogues between the user and app, but it is only good for simple things about the state of the application on variables for things you don't want to save.
If you want to save things, you need a database.
So, I taught myself how to use dynamoDB to save java objects, and it was actually incredibly simple to put that together. Marshaling and unmarshaling data is incredibly easy to set up and allows you to do some incredibly complex things without a lot of tedious code. This was a game changer, and knowing how to work with databases opened up the path for me to be able to build my most complex app to date, which is a trivia game. I'll talk about that one next post, but for now let me mention some things I did wrong with the mad libs application.
- I stored each variable in the session.
- I declared the mad libs locally in static memory.
- I attempted to handle json in the session.
This means that my load time was a lot longer than I would have liked when the app first starts up, but it also means that I have to declare like ten separate session variables to store the nouns, adjectives, and other features that are being used.
There are at least a million better ways of doing this, but I chose to do it the wrong way. I still have to go back and fix that app eventually, but at least it works. The good part was that I learned a lot about how to do things right because of it.
Building custom solutions is the fun part of writing the apps.
Some basics of writing apps can be found on amazon's websites and git servers. Basically, you just need to write the methods to handle the intents and sessions of your application. You read slots out of the intent which were passed in from the front end, and you read session attributes for the things that you store and pass back and forth for your own reference. Pretty much the entire complexity of the app and what it is capable of doing comes down to how you, as the developer, choose to write the code.
This probably sounds pretty complex, but it is really quite simple once you get the hang of it. Anymore, I can build and deploy a new simple skill in about an hour, and if it is wired up with an API back end it can be a fairly complex and powerful skill and still take a very limited amount of time.
I will be discussing the basics of building a flash briefing skill and getting it deployed. Then, I will show the basics of building a custom skill and getting it out into the world. It won't be long before you can build and deploy some great apps of your own!