fundamental of android

20
BY ADARSH PATEL WORKSHOP ON

Upload: adarsh-patel

Post on 13-Apr-2017

43 views

Category:

Education


0 download

TRANSCRIPT

Page 1: Fundamental of android

B Y A D A R S H P A T E L

W O R K S H O P O N

Page 2: Fundamental of android

Index

Introduction to Android

Introduction to Android Studio IDE

Introduction to Activity

Goto Next Activity

Goto Next Activity with Data

Manage User Sessions

Receive Single Data from Server

Receive Multiple Data from Server

Bind Single Column Data with ListView

Bind Multi Column Data with ListView

http://arthtechnology.com

Page 3: Fundamental of android

Introduction to Android

http://arthtechnology.com

Page 4: Fundamental of android

Introduction toAndroid Studio IDE

Page 5: Fundamental of android

Introduction to Activity

http://arthtechnology.com

Page 6: Fundamental of android

Goto Next Activity

http://arthtechnology.com

Page 7: Fundamental of android

Actually There are many options

Goto Another Activity

Goto Another Activity with Data

Open Browser

Open Share Intent

Open Another Activity to Select Image

Open Another Activity to Select File

http://arthtechnology.com

Page 8: Fundamental of android

Goto Another Activity

Intent intent = new Intent(getApplicationContext(),

MainActivityHome.class);

intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

startActivity(intent);

http://arthtechnology.com

Page 9: Fundamental of android

Goto Another Activity with Data(Temporary)

Display one item when you click on list of item

Pass just true/false or just id

Pass Index (like from where you are coming...) (Eg. Login

page is only one and we are using from workshop and

training both so we need to

http://arthtechnology.com

Page 10: Fundamental of android

Goto Another Activity with Data(Temporary) (Example)

Intent intent = new Intent(getApplicationContext(),

MainActivityHome.class);

intent.putExtra("varable1","value")

startActivity(intent);

varable1= getIntent().getStringExtra("varable1");

http://arthtechnology.com

Page 11: Fundamental of android

Manage User Sessions(Permanent)

public static final String PREFS_NAME = "Preference";

SharedPreferences settings =

getSharedPreferences(PREFS_NAME, 0);

SharedPreferences.Editor editor = settings.edit();

editor.putString("mobiletatus", "Y").apply();

String par1 = settings.getString("mobile", "9898036028");

http://arthtechnology.com

Page 12: Fundamental of android

Share IntentIntent share = newIntent(android.content.Intent.ACTION_SEND);

share.setType("text/plain");

share.putExtra(Intent.EXTRA_SUBJECT, "RTO CodeApps"); share.putExtra(Intent.EXTRA_TEXT, "Try RTO Code Apps(Link : https://goo.gl/isqXV7 ) Provides All Vehicle RegCode "); startActivity(Intent.createChooser(share, "Share link!"));

http://arthtechnology.com

Page 13: Fundamental of android

Open Another Activity to SelectImage

http://arthtechnology.com

Page 14: Fundamental of android

Open Another Activity to Select File

http://arthtechnology.com

Page 15: Fundamental of android

Its all about sending data one Activity to another activity

or

Get some data/File/Imagefrom Android

http://arthtechnology.com

Page 16: Fundamental of android

Now its time to fetch data from Server

http://arthtechnology.com

Page 17: Fundamental of android

Fetch Data from Server (some cases)

Validate User (Is userid and password is correct or not)Change User PasswordUser forgot his/her password send by smsSend otp to verify mobile numbersend invitation to their friends about app via serverCheck I have applied for Android FundamentalworkshopFetch list of upcoming workshops of Arth TechnologyFetch list of completed workshops of Arth TechnologyFetch list of workshops I have applied

http://arthtechnology.com

Page 18: Fundamental of android

Example to fetch data

http://arthtechnology.com

Page 19: Fundamental of android

Example to fetch data

Login with okhttp (Fetch Data from Server)

Login with AsyncTask (Fetch Data from Server)

Save data to Preference

Load data from Preference

http://arthtechnology.com

Page 20: Fundamental of android

A R T H T E C H N O L O G Y

T H A N K Y O U !