This is a good example of login and Sign up page using SQLite. In this project, we have 3 activities and 2 java classes. Contact.java DatabaseHelper.java Display.java MainActivity.java SignUp.java activity_main.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.blogspot.csdevbin.sqliteexample.MainActivity"> <EditText android
Posts
Most Android apps need to save data, even if only to save information about the app state during onPause() so the user's progress is not lost. Most non-trivial apps also need to save user settings, and some apps must manage large amounts of information in files and databases. This class introduces you to the principal data storage options in Android, including: Saving key-value pairs of simple data types in a shared preferences file Saving arbitrary files in Android's file system Using databases managed by SQLite Source: blog SharedPreferences Example
main.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.blogspot.csdevbin.webview.MainActivity"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Web View" android:id="@+id/button" android:layout_alignParentTop="true" android:layout_centerHorizontal
Add Internet Permission in manifest file. <uses-permission android:name = "android.permission.INTERNET" /> activity_first.xml ?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:orientation="vertical" tools:context="com.blogspot.csdevbin.accno.First"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" and
In android app when ever activities changes their orientation (portal/landscape) ,they are going to loss their UI state. To avoid this, we use OnSaveInstantState Method. activity_main.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.blogspot.csdevbin.onsaveinstantstatemethod.MainActivity"> <EditText android:layout_width="wrap_content" android:layout_height="w