Android Development for Beginners 16

Beginners Android Development 16In this part of my App Inventor tutorial I show how to do something that has been requested many times. I’ll show how to share a database between multiple screens with App Inventor.

One of you asked me to keep this very simple and so I will. I’ll show how to add, update and remove data from a database from multiple screens. All of the blocks used follow the video below.

If you like videos like this, it helps to tell Google plus with a click here [googleplusone]

Screen1 App Inventor Blocks

Click the image below to view it full screen

App Inventor Add to TinyDB

FriendEditScreen App Inventor Blocks

Click the image below to view it full screen

App Inventor Use Database Multiple Screens

App Inventor Design Views

App Inventor Screen1 Design View

App Inventor Design View FriendEditScreen

16 Responses to “Android Development for Beginners 16”

  1. I.Nemlich says:

    Hello Derek,
    Once more I would like to thank you for your excellent work.
    I want to parse a csv data file, like stock quotes from Yahoo’s api, and be able to get each item and store it separately but I am not sure about the method I should use.
    Can you give an explanation or an example.

    Many thanks for your kind help,
    I. Nemlich

  2. Yusuf says:

    Hi Derek, You cover so many topics so well that I feel a bit greedy asking for more…but I am volunteering to develop a scheduler app for my faith group and am stuck. The app will have a calendar where users can select a certain date and then take ownership of certain tasks. The calendar I am trying to access is using PHP. I am not familiar with this. Is this something you might cover in this series? Can AI access PHP type files like you showed with JSON formatted data in an earlier tutorial?
    Thanks and keep up the great work.

    • Derek Banas says:

      Yes you can access outside PHP files. I will upload a tutorial today that will show how people using separate devices can share data on a server. Using lists of lists with App Inventor may be all you need. I’ll also soon cover canvas which will allow you to make more complex interfaces. i hope they help ๐Ÿ™‚

      • Yusuf says:

        Hi Derek,
        Back to my calendar question… there an API in AI that can create a calendar. I am trying to create one and it seems to be getting too complex.

        • Derek Banas says:

          Hi Yusuf,

          I don’t know of one. You basically need to set up the interface in a grid system. Height and weight for everything is normally set up as a percentage of the screen width and height. I’ll get back into regular Java Android soon.

          • Yusuf says:

            Do you think maybe this might be beyond the scope of AI and I should rather try JAVA andriod so I have access to more APIs?

            • Derek Banas says:

              You could create a bunch of boxes in a grid system and then put them in a list and place the numbers in the right place in the grid. I’ll also cover canvas soon which will open up more opportunities.

  3. I’m looking for the weekend so I can catch up with your tutorials.

    I’m planning to have a small database in my app and then export it to .csv so it can be shared and opened in a computer, this would be a kind of report for the user.

    It would be a small database…just 2 tables and probably 6-7 columns on each table.

    Do you think this is the right approach?

    Thanks in advance.

    Manuel Vazquez

    Thanks Derek.

    • Derek Banas says:

      You could definitely use the TinyWebDB that I just covered for that. if you want the data to last over the long term it is very easy to download the code and upload to your own server. I think that would get your app going very quickly.

      I hope that helps ๐Ÿ™‚

      • I’m glad to see you’re covering that.

        The steps on my plan are below
        1. Finish the app and save the data locally on the android device.

        2. Upgrade the app so you can export the info into a .csv file.

        3. Migrate the DB to a server so I could save the data remotely.

        4. Upgrade my app so you can use a different android device, you’d have to login, and see/update the DB.

        5. Create a simple Web Page so you can see/update the shared DB.

        6. Develop the app for iOS (I hate iOS but following Eugeny’s advice I’d have to do it)

        It’s a long way to go but I’m eager to finish this app, your tutorials are helping me a lot.

        Manuel Vazquez

        • Derek Banas says:

          I’m glad you are finding the videos useful. Everything you want to do can be done. I don’t know if I’d worry about iOS now. Making an Android app is enough to put on your plate for now. I think he said he developed on cross platform mainly because Unity 3D does that on its own? I know I don’t do what Eugeny does, but I never get asked to develop for iOS.

  4. DMac says:

    Hi Derek, I am getting the run time error message when i try to replicate what in the tutorial, Copying the error message let me know what i am doing wrong.

    The operation add items to list cannot accept the arguments: *empty-string* test
    Note: You will not see another error reported for 5 seconds.

  5. Gary says:

    I have started following these videos, I have an error with this on on “Friends” Video #16. I can type a name in the box and add to to list ok, when I go to the list the name is there, however when I click on the name a black box pops up and says “Bad arguments to select list item” “The operation select list item cannot accept the arguments: (gary) gary” End Application. So I checked the blocks and found in the After picking section I had “FriendListPicker” w\”Selection” and changed it to w\”SelectionIndex” Thinking that would fix it but it didn’t. It just change the message a little to “Bad arguments to select list item” “The operation select list item cannot accept the arguments: (gary) *empty-string*. Could you please help.

    • Gary says:

      Further Checking I found that the blocks work OK in the App Inventor Emulator now that I changed to “SelectionIndex”. But when I build and save apk. to my computer and email to my phone. After install on phone the app crashes when I pick a name say “gary” from the picker. Box pops up and says โ€œBad arguments to select list itemโ€ โ€œThe operation select list item cannot accept the arguments: (gary) *empty-string* End Application. Phone is a Blu Studio 5C HD running kitkat 4.4.2. Thank You For Your Time.

Leave a Reply

Your email address will not be published.