Posts

Showing posts from August, 2017

Developing an android app which displays a form with AutoCompleteTextView

Image
Practical - 9 Develop an android app which displays a form to get following information from user. Username Password Email Address Phone Number Country State Gender Interests Birth Date Birth Time Form should be followed by a Button with label “Submit”. When user clicks the button, a message should be displayed to user describing the information entered. Utilize suitable UI controls (i.e. widgets). [When user enters country in AutoCompleteTextView, list of states should be displayed in Spinner automatically.] Download Practical Code: MainActivity.java package com.believe.myform; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.TextView; public class ViewData extends AppCompatActivity { TextView musername; TextView mpassword; TextView memail; TextView mphoneNumber; TextView mcountry; TextView mstate; TextView mgender; TextView minterests; TextView

How to Create a login Activity

Image
Practical - 10 Using Android, Create a login Activity. It asks “username” and “password” from user. If username and password are valid, it displays Welcome message using new activity. Download Practical Code: MainActivity.java package com.believe.loginmodule; import android.content.Intent; import android.os.Build; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class MainActivity extends AppCompatActivity {     EditText musername;     EditText mpassword;     Button mlogin;     @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {             Window w = getWindow(); // i