This Page Tablet Tutorial, How To Add 'Horizontal Scroll View'
Prev Page Tablet Tutorial, How to Add 'Image view'
Next Page Android Tablet Tutorial, How To Implement a 'Frame Layout'
If you are just arriving at this page; you can
gohere to first - Create your simple Android app
Once you create your App you can follow along with each android tablet tutorial.
AIDE and ANDROID STUDIO
We are using AIDE, to create these tutorial apps on our 8.9" tablet with android version 4.2.2; using the Android Java XML programming language.
We are using the AIDE coding editor to code our pages; and then to Create - RUN our apps. AIDE is a SDK coding environment for android devices like a tablet or smartphone.
AIDE has a free and paid version. The paid version is required if you want to create Java/xml template apps; and add a 'keystore' to your App. With a keystore, you can publish it to the market places like
Google and Amazon.
Once you create your apps code pages, you need to RUN the app to build your apk package; then you INSTALL it on your tablet or smartphone.
can also create; RUN your apps using the code in these tutorials, with Android Studio. Android Studio is for desktop computers. Choose Java XML as the programming language.
Android Studio is free to install and use; and has helpful guides.
Complete Example Codes are available for each of our tutorials. With these example codes you can make a functioning android app in
either AIDE or Android Studio.
In our previous tablet tutorials, we continued on with the same app, however, for this tutorial we are creating a new app.
We named it Japanese and the text placed next to the App Icon will read 'Japanese Verbs' For the horizontal scroll view
we are using one image coded several times so that the screen display becomes scrollable.
If you are not familiar
with creating a simple app GoTo our Tutorial How to create a simple App in Android for tablets.
Just name it "Japanese", if you are following along with this tutorial.
What the App 'Japanese' Will Look Like
Once you add the code and images, your app should look similar to these one.
Because the images we added exceed the width of the physical screen; the 'horizontal scroll' allows the images to
be scrolled to the right of the display's physical parameter; and then you can scroll left also.
For this tutorial: The Code For the Horizontal Scroll View
To add a horizontal scroll view to your android app
you need to add the horizontal scroll view code as shown in this image.
FOR THIS TUTORIAL
The Code For the Images
For an android horizontal scroll view,
you add images to the layout file code in the same manner as if you were just adding an image.
android:layout_width:="wrap_content", and android:layout_height:="wrap_content", and add:
All images are placed in the res/drawable-hdpi folder, you don't need to code the
.png, because it is in the drawable folder the android system knows it is an image. Although we are using the same image several times in this scrollview app,
we need only add it one time to the res/drawable-hdpi folder.
The Code For the App Icon
Coding for the App icon
is placed in the manifest file as shown in this image.
The App icon
image is placed in the drawable-hdpi folder; and coded in the manifest file as: android:icon="@drawable/yomu"
A label(text) can be added with the App Icon and it is placed next to the App Icon at top of screen display.
To code the label we use the android:label="@string/app_name", which is coded in the manifest file, in the
code. The actual text you use is placed in the
strings.xml file, which is at res/values/strings.xml, and is coded as shown in this image. For this app our
label text reads: Japanese Verbs.
Coding Tips - FYI
Horizontal Scroll View
By default the images are placed next to each other. If you want space between each image you can do so by using this code:
You can change this as you like for the spacing.
For our tutorial app: Japanese, we added this code to some of the images.
Additional reading at Android Developer Website on 'horizontal scroll view'
....horizontal scroll view attributes
EXAMPLE CODE; Code For This Tutorial
This is the code for this app 'Japanese ' THE - Horizontal Scroll View tablet tutorial;
so you can just copy and paste it
into your layout file: main.xml
Also, code your manifest file
to include the app icon name as shown in the image on this page,'android:icon="drawable/yomu' and code
your strings.xml file
to say 'Japanese Verbs';'string name='app_name Japanese Verbs, and finally, SAVE, the two images
shown in the Example Code to your
tablet, then copy and paste them into your AppProjects/Japanese App at res/drawable-hdpi folder. Use your tablet`s file manager to paste the files into
the apps drawable folder. You cannot paste them directly from within the AIDE editor.
TO COMPILE AND RUN YOUR APP:
App Name is 'Japanese' - located at AppProjects/Japanese in AIDE, open the AIDE app, then open App Projects, THEN select the 'Japanese',
app from your files hierachy; then click on a file from the app, like strings.xml Make sure at top of page, the app name Japanese is there next to
AppProjects like so: AppProjects/Japanese, then you know you have the proper App. Once a file is in the editor, you can save it, then RUN your APP.
Make sure you SAVED EACH PAGE, before you RUN your code. SAVE, RUN, INSTALL, OPEN, your Japanese App. Once it has been
installed on your tablet, you can open it Simply by Clicking on the App Icon, YOMU, from the apps directory
on your tablet. Just look
for the YOMU icon, as shown in this tutorial.
If you make further changes to this Japanese App, you need to SAVE, RUN, UPDATE, OPEN the app.
This free script provided by
for creating Android Apps on your tablet or cell phone(android).
Free and Paid - with Free create android Java/xml template apps and couple free android lessons. With paid
some lessons included, create android Java/xml template apps; and create a keystore for your app. With a keystore you can publish your app at markets like Google.
- for creating Android Apps on your desktop computer.
Free to Install and Use
GoTo Android Studio
Learn more - Android Studio
The Java XML files we code(example codes) and the Android Apps we create in our Free
Tutorials are compatible with Android Studio and AIDE. Just choose Java XML as your Programming Language.
You May Like:
Make Sushi Rolls
Taste World Wines Flavours and Aromas