First off, I'm totally brand new to any kind of coding. I started trying to make an app with App Inventor, but it became too big for that and couldn't do exactly what I was wanting. So now I'm attempting to do it all from scratch.
I think I'm getting things figured out, but I'd like to check and see if this makes sense before I got and build the whole thing.
What I'm aiming for is a main screen with a bunch of buttons on it. Each of those buttons will take you to a set of directions that is a series of pictures and text that you can flip through.
What I'm thinking is to make an activity for the main screen and one for each set of directions. On the main one, I put a table layout which contains all the buttons. Each of the directions sets will be its own activity with a view flipper to go through all the pics/text.
Does that make sense? Is there a better way to do this or is this good? Thanks!
Your method makes sense but can be improved. For a beginners point of view it would appear easier to make seperate activities for each of the different directions set.
In the future you could possibly break this down into two activities. The first one as you outlined but the second would differ.
The second activity would contain the code to flip through data but the data itself will differ. You can use something called extras. See Common Tasks and How to Do Them in Android - Some Intent examples
You launch the second intent/activity with data that can be used to identify which button the user pressed and in the second activity, read this value.
You would have to make arrays in the second activity for each of the direction sets, then depending on the option the user selected, apply the data from these arrays to the users display/view.
However, for a beginner your idea seems perfect. Get used to the new environment and tools then start looking into more advanced methods.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With