Tablet Tutorials android, how to 'horizontal scroll view'
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.


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.

You 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.
Horizontal Scroll View App Android

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.


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"

coding the app icon in the manifest file

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 application 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 strings in android

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.

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.

Example Code:
Use Mouse To Copy Paste the Code

Save these images to your tablet, then place in res/drawable-hdpi folder of the AppProject 'Japanese'
yomu.png is your 'app icon' image; save it to the res/drawable-hdpi folder, and code it in the manifest file
verbtothink.png is the image for the horizontal scroll; save it into the res/drawable-hdpi folder It is coded in the layout file.

This free script provided by
JavaScript Kit

Share This Page

AIDE 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.
GoTo Aide

ANDROID STUDIO - 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


The Coded Pages

Beginners Article
About Our Tutorials
Coding androidmanifest.xml
Coding main.xml
Coding strings.xml
Coding drawables

Tutorials II
Java XML Learning To Code
Create A Simple Android App

Change App Icon
Add Text and Style
Add Buttons To App
Placing Text
in Buttons

Change View
Background Color

Change Screen

Add Image to
Activity View

Add Horizontal
Scroll View

Add a Frame Layout
How to Add Themes
To Your App

How To Code
Customized Styles

Code a Toast Message

Coding Resource


How To Code
Screen Orientation

Clickable Button To URL
Image Button
with Selector

Linear Layout with
Weight Attribute

OnClick Displays

Screen Density
Coding Practices

and Courses
for tablets

Android Studio
for computers

Android Studio
Course - Paid

Java Programming
Course - Free

Git Hub Course


Code Canyon Paid From $1(can buy individually) Free and Paid From $1 (can buy individually)

About Our Images

All images on this page are copyrighted material.
You can use the images included with each tutorial for the purpose of creating your android app. These images are not to be distributed or sold.

APP Marketplace
Launching Your Android App
How To Be Successful

Android App Libraries
What are they and how
to implement them

How To Implement ScrollView

What is a WebView

View all Articles Here


How To Add Your Google Key
To Manifest.xml
Web Article

How To Sign Your APK Web Article

Google Developer Console
Create Account Submit Your App
Web Article

Amazon App DRM - APK KEY
Amazon Developer Portal
Create Account - Submit Your App

Google's In-App Billing for App monetization.

Monetizing Your App
How Tos

Follow Us On Twitter
Tweets by @codeandroidapps