- Android 2.3 3 Tutorial Android Studio
- Web Browser For Android 2.3.3
- Install Android Market On Coby Kyros MID7012 (or Most Other ...
- Android Basics
- Android - User Interface
- Android Advanced Concepts
- Android Useful Examples
Minimum SDK: API 9 – Android 2.3 (Gingerbread). Run app Create Virtual Device (Emulator): Nexus S – API 10 – Android 2.3.3 Run your Virtual Device, Nexus S Run your first app in device just created Application in opening with text “Hello World!” Congratulation! You just created your first app in Android Studio! See Video Tutorial. Com.android.vending.3.3.12.apk; Ok, this step is important. DO NOT GO TO THE HOME SCREEN!! Press and hold the power button on the tablet and turn it off. Now turn it back on! After start-up, you will see a menu with two options. Check the “Use this as default” box on the bottom, then select the option on top (“Launcher”). The App Tutorial on Accessing Layout Editor in Android Studio v 2.3.3 can help to to start with layout editor. You can read about the other features of Android Studio. You can use Android Studio User Guide by developers.
- Android Useful Resources
- Selected Reading
SQLite is a opensource SQL database that stores data to a text file on a device. Android comes in with built in SQLite database implementation.
SQLite supports all the relational database features. In order to access this database, you don't need to establish any kind of connections for it like JDBC,ODBC e.t.c
Database - Package
The main package is android.database.sqlite that contains the classes to manage your own databases
Database - Creation
In order to create a database you just need to call this method openOrCreateDatabase with your database name and mode as a parameter. It returns an instance of SQLite database which you have to receive in your own object.Its syntax is given below
Apart from this , there are other functions available in the database package , that does this job. They are listed below
Sr.No | Method & Description |
---|---|
1 | openDatabase(String path, SQLiteDatabase.CursorFactory factory, int flags, DatabaseErrorHandler errorHandler) This method only opens the existing database with the appropriate flag mode. The common flags mode could be OPEN_READWRITE OPEN_READONLY |
2 | openDatabase(String path, SQLiteDatabase.CursorFactory factory, int flags) It is similar to the above method as it also opens the existing database but it does not define any handler to handle the errors of databases |
3 | openOrCreateDatabase(String path, SQLiteDatabase.CursorFactory factory) It not only opens but create the database if it not exists. This method is equivalent to openDatabase method. |
4 | openOrCreateDatabase(File file, SQLiteDatabase.CursorFactory factory) This method is similar to above method but it takes the File object as a path rather then a string. It is equivalent to file.getPath() |
Database - Insertion
we can create table or insert data into table using execSQL method defined in SQLiteDatabase class. Its syntax is given below
This will insert some values into our table in our database. Another method that also does the same job but take some additional parameter is given below
Sr.No | Method & Description |
---|---|
1 | execSQL(String sql, Object[] bindArgs) This method not only insert data , but also used to update or modify already existing data in database using bind arguments |
Database - Fetching
We can retrieve anything from database using an object of the Cursor class. We will call a method of this class called rawQuery and it will return a resultset with the cursor pointing to the table. We can move the cursor forward and retrieve the data.
There are other functions available in the Cursor class that allows us to effectively retrieve the data. That includes
Sr.No | Method & Description |
---|---|
1 | getColumnCount() This method return the total number of columns of the table. |
2 | getColumnIndex(String columnName) This method returns the index number of a column by specifying the name of the column |
3 | getColumnName(int columnIndex) This method returns the name of the column by specifying the index of the column |
4 | getColumnNames() This method returns the array of all the column names of the table. |
5 | getCount() This method returns the total number of rows in the cursor |
6 | getPosition() This method returns the current position of the cursor in the table |
7 | isClosed() This method returns true if the cursor is closed and return false otherwise |
Database - Helper class
Android 2.3 3 Tutorial Android Studio
For managing all the operations related to the database , an helper class has been given and is called SQLiteOpenHelper. It automatically manages the creation and update of the database. Its syntax is given below
Example
Here is an example demonstrating the use of SQLite Database. It creates a basic contacts applications that allows insertion, deletion and modification of contacts.
To experiment with this example, you need to run this on an actual device on which camera is supported.
Steps | Description |
---|---|
1 | You will use Android studio to create an Android application under a package com.example.sairamkrishna.myapplication. |
2 | Modify src/MainActivity.java file to get references of all the XML components and populate the contacts on listView. |
3 | Create new src/DBHelper.java that will manage the database work |
4 | Create a new Activity as DisplayContact.java that will display the contact on the screen |
5 | Modify the res/layout/activity_main to add respective XML components |
6 | Modify the res/layout/activity_display_contact.xml to add respective XML components |
7 | Modify the res/values/string.xml to add necessary string components |
8 | Modify the res/menu/display_contact.xml to add necessary menu components |
9 | Create a new menu as res/menu/mainmenu.xml to add the insert contact option |
10 | Run the application and choose a running android device and install the application on it and verify the results. |
Following is the content of the modified MainActivity.java.
Following is the modified content of display contact activity DisplayContact.java
Following is the content of Database class DBHelper.java
Following is the content of the res/layout/activity_main.xml
Following is the content of the res/layout/activity_display_contact.xml
Following is the content of the res/value/string.xml
Following is the content of the res/menu/main_menu.xml
Following is the content of the res/menu/display_contact.xml
This is the defualt AndroidManifest.xml of this project
Let's try to run your application. I assume you have connected your actual Android Mobile device with your computer. To run the app from Android studio , open one of your project's activity files and click Run icon from the tool bar. Before starting your application,Android studio will display following window to select an option where you want to run your Android application.
Select your mobile device as an option and then check your mobile device which will display following screen −
Now open your optional menu, it will show as below image: Optional menu appears different places on different versions
Click on the add button of the menu screen to add a new contact. It will display the following screen −
It will display the following fields. Please enter the required information and click on save contact. It will bring you back to main screen.
Now our contact sai has been added.In order to see that where is your database is created. Open your android studio, connect your mobile. Go tools/android/android device monitor. Now browse the file explorer tab. Now browse this folder /data/data/<your.package.name>/databases<database-name>.
Android Studio Tutorial For Beginners Step By Step
Android Studio is the official IDE (integrated development environment) for developing Android Apps by Google. It is based on JetBrains’ IntelliJ IDEA software and has lots of amazing features which helps developer in creating Android App.
Android Studio is available for free download on Windows, Mac OS X and Linux.
Here we are going to share lots of guide, tips, tricks and shortcut of Android Studio to help developer easily understand the tool.
Eclipse Vs Android Studio
Android App Development is mostly done in two IDE i.e. Eclipse and Android Studio. Earlier Eclipse was the popular IDE but now Android Studio has taken over it. This is because Google has ended the support for Eclipse and now only focused on Android Studio. Google also recommended developer to import their Android projects and use Android Studio.
“We are focused on Android Studio so that our team can deliver a great experience on a unified development environment. Android tools inside Eclipse will continue to live on in the open source community via the Eclipse Foundation.”
Prerequisites For Learning Android Studio:
There are two prerequisites for learning Android Studio tips:
System Requirement – First your system OS must be either Windows, Max OS X or Linux with below requirement:
- Microsoft Windows 10/8.1/8/7/Vista/2003/XP (32 or 64 bit)
- Mac OS X 10.8.5 or higher, up to 10.10 to up 10.10.2 up 10.10.3 on 10.10.5 (Yosemite)
- GNOME or KDE or Unity desktop on Ubuntu or Fedora or GNU/Linux Debian
- Minimum RAM: 2GB
- Recommended RAM: 4GB
- Disk Space: 500 MB disk space
- Android SDK Space Reqirement: At least 1 GB for Android SDK, emulator system images, and caches
- JDK: Java Development Kit (JDK) 7 or higher
- Screen Resolution: 1280×800 minimum screen resolution
- Prefer faster processor according to your budget
Android Studio:
The second thing you need is to download Android Studio on your system and install it. It is available for free download on Windows, Mac OS X and Linux OS.
Web Browser For Android 2.3.3
Android Studio Tutorials For Beginner – Step By Step:
Below are the tutorials links on Android Studio:
- Start New Project – Learn how to start or create a new project in Android Studio
- Open Project – Learn how to open projects and recent project
- Reopen, Close & Save Project – Learn more about how to open saved projects and close current project in Android Studio.
- Create New Activity – Learn to create New Activity in Android Studio further create XML file for designing UI and java file coding.
- Create New Java Class -Learn to create New Java Class in Android Studio.
- Create Virtual Device – Learn more to create a new AVD (virtual device) in Emulator.
- Run App In AVD – Learn how to run and test Android App in AVD of Emulator.
- Run/Test App in Real Device – Click to know more about how to run app in real device.
- Create Drawable Resource XML File – Learn how to create drawable resource XML file in Android Studio.
- Add/Create Landscape Layout – Learn to design app in Landscape orientation in Android Studio.
- Create Local HTML File – Learn how to create local HTML file in Android Studio.
- Create Raw Folder – Click & get more about how to create Raw Folder in Android Studio.
- Add/Create Assets Folder – Learn more to create Assets folder in Android Studio.
- Install Genymotion Emulator – Learn the steps to install Genymotion Emulator in Android Studio.
- Import/Add External JAR File – Learn how to import an External JAR file to Android Studio.
- Change API SDK Level – Learn how to change the SDK level of API in Android Studio.
- Create/Add New Package Inside Src Folder – Learn to know about creating new package inside Src Folder in Android Studio.
- Creating Folders for Adding Different Resolution Images – Learn how add folder for adding images with different resolution in Android Studio.
- Create An Interface – Learn how to create Interface in Android Studio.
- Add Image to Drawable Folder in Android Studio – Learn Steps to add image to Drawable Folder in Android Studio.
- Change Icon Of Your Android App – Learn and Follow steps to change the android app icon in Android Studio.
- Add Audio To Android App – Follow steps defined to add audio to your android application.
- Application Launcher Icon Size – Here you can learn about different application launcher icon sizes in android studio.
- Basic Activity In Android Studio – Here you can learn about how to create a basic activity in android studio.
- Implement Abstract Method – Here you can learn about how to implement abstract methods on clicks or using shortcuts in android studio.
- Change Package Name In Android Studio – Here in this tutorial I am going to discuss step by step how to rename/change package name in Android Studio
- Generate Signed Apk In Android Studio For Publishing & Updating App – If you have completed developing your Android App and now wants to publish it on Playstore. Then the first step you need to take is generate signed apk in Android Studio for publishing your App.
- How To Publish Android App On PlayStore – Haven’t you publish any Android App on Play store? Don’t worry if you haven’t because it’s very easy and this tutorial is going to teach step by step how to publish your first Android App on Play store.
- How To Create Anim Folder & Animation File In Android Studio – To apply Animations to our Application sometimes we need to make an anim folder in Android Studio to store animation file under the resource folder of our application.