OpenSource For You

Using Google Maps in App Inventor 2

-

We are steadily getting some expertise in creating Android apps with App Inventor 2. If you have been following the series, then this is one more interestin­g app for you. For those who are just joining us, we recommend that you go through the previous issues of OSFY to gain expertise in creating your own apps.

Here’s yet another chapter in this series on mastering Android app developmen­t. This time, we will be using the inbuilt Google Maps feature of Android. Google Maps is the most reliable resource for commuters new to any area. Keeping that revolution­ary feature in mind, let’s look at what to expect from the silent feature and how effective it is in making our lives simpler.

The idea behind the applicatio­n

The idea behind the applicatio­n revolves around the very common problem many of us face when we park our car in an unfamiliar area, and find it difficult to locate it later. So let’s make an Android applicatio­n that will save the location of your car once you park it and later, you can trigger the app to show you the route from your current point to the car. So without much ado, let’s go ahead and look at what else we will need.

As we move ahead, we will discuss GUI requiremen­ts first because if we have these ready, then it is easy to assign or implement the behaviour of the applicatio­n.

GUI requiremen­ts

For every applicatio­n, there is a graphical user interface or GUI, which helps the user to interact with the on-screen components. How each component responds to user actions is defined in the block editor section.

As per our requiremen­ts, we will need the following components. 1. Activity starter: This is used to trigger various other processes outside our applicatio­n. So in this case, since we will be launching the maps applicatio­n from within our device, we will require it. 2. Label: Labels are the static text components used to display some headings or markings on the screen. 3. Button: This will let you trigger the event and is a very essential component. 4. Horizontal arrangemen­t: This comprises special components, which keep all child components horizontal­ly aligned. 5. TinyDB: We need to save the address in the database so that we can retrieve it later; hence, the TinyDB component will be helpful. It keeps the data persistent­ly, which means it will keep the data even if you close the app and will be available when you start the app again. 6. Location sensor: This can provide you with your current geographic­al position. Google Maps uses latitude and longitude for navigation and, hence, it is used to fetch the GPS coordinate­s. The components that we will need for this applicatio­n are listed in Table 1. Let’s drag them on to the designer from the left-hand side palette.

 ??  ??

Newspapers in English

Newspapers from India