This document provides an overview of key Android concepts including:
- Android's history and version timeline from 1.0 to Oreo.
- The Android activity lifecycle including methods like onCreate(), onStart(), onResume(), etc.
- What fragments are in Android and their core lifecycle methods.
- Different types of layouts that can be used in an Android app like RelativeLayout, LinearLayout, etc.
- How to integrate APIs and handle network requests and responses in an Android app.
It also provides code examples and tips for beginners on resources for learning Android development.
The document discusses the four main components of an Android application: Activities, Services, Broadcast Receivers, and Content Providers. Activities provide user interfaces and handle user interactions. Services run in the background performing long-running tasks. Broadcast Receivers listen for system-wide broadcast announcements. Content Providers manage access to structured data between applications. Each component has a defined lifecycle and purpose for building Android applications.
in this presentation i will discuss fragment and how to use it to enhance your android development, also know the basics of making more than one layer in your apps
Android development - Activities, Views & IntentsLope Emano
Activities provide screens for user interaction and have lifecycles to manage memory. The lifecycle involves states like active, paused, stopped which trigger callbacks like onCreate(), onStart(), onPause(). Views are UI components like TextView and occupy a rectangular area, with attributes like width, height. ViewGroups arrange views and include LinearLayout and RelativeLayout. Input events like clicks are handled via listeners. Intents launch other activities by specifying the class and optional data.
The document discusses the basic components of an Android app. It explains that an Android app consists of components like activities, services, broadcast receivers, and content providers. Activities provide the main user interface and common ones include launching the app and navigating within it. The app manifest file defines these components. The document also covers activities and intents, explaining how activities are launched via explicit and implicit intents and how data can be passed between activities.
The document discusses the basic components of Android applications:
- Activities represent single screens and user interfaces. The first activity launched is the entry point.
- Services run in the background for long-running tasks like playing music.
- Broadcast receivers respond to messages from other apps and the system, like downloading completion.
- Content providers manage shared app data stored in files, databases, and more.
The document discusses Android activities and fragments. It defines an activity as representing a single screen with a user interface. It notes that an app may have multiple activities for different screens like email lists, compose, and read. It then discusses the activity lifecycle and callbacks like onCreate(), onStart(), onResume(), etc. It provides an example logging the lifecycle. It defines a fragment as a modular piece of UI/behavior that can be placed in an activity. It discusses combining fragments in different configurations for tablets vs phones. It also covers the fragment lifecycle and provides an example creating two fragments for landscape and portrait orientations.
Fragments allow modularization of activities on larger screens like tablets. A fragment represents a behavior or UI portion and has its own lifecycle callbacks. Fragments can be placed in an activity layout via XML or added dynamically in code. Multiple fragments can be combined in a single activity to build a multi-pane UI. The activity lifecycle influences fragments, and fragments can be retained across configuration changes using setRetainInstance(true).
The document discusses the four main components of an Android application: Activities, Services, Broadcast Receivers, and Content Providers. Activities provide user interfaces and handle user interactions. Services run in the background performing long-running tasks. Broadcast Receivers listen for system-wide broadcast announcements. Content Providers manage access to structured data between applications. Each component has a defined lifecycle and purpose for building Android applications.
in this presentation i will discuss fragment and how to use it to enhance your android development, also know the basics of making more than one layer in your apps
Android development - Activities, Views & IntentsLope Emano
Activities provide screens for user interaction and have lifecycles to manage memory. The lifecycle involves states like active, paused, stopped which trigger callbacks like onCreate(), onStart(), onPause(). Views are UI components like TextView and occupy a rectangular area, with attributes like width, height. ViewGroups arrange views and include LinearLayout and RelativeLayout. Input events like clicks are handled via listeners. Intents launch other activities by specifying the class and optional data.
The document discusses the basic components of an Android app. It explains that an Android app consists of components like activities, services, broadcast receivers, and content providers. Activities provide the main user interface and common ones include launching the app and navigating within it. The app manifest file defines these components. The document also covers activities and intents, explaining how activities are launched via explicit and implicit intents and how data can be passed between activities.
The document discusses the basic components of Android applications:
- Activities represent single screens and user interfaces. The first activity launched is the entry point.
- Services run in the background for long-running tasks like playing music.
- Broadcast receivers respond to messages from other apps and the system, like downloading completion.
- Content providers manage shared app data stored in files, databases, and more.
The document discusses Android activities and fragments. It defines an activity as representing a single screen with a user interface. It notes that an app may have multiple activities for different screens like email lists, compose, and read. It then discusses the activity lifecycle and callbacks like onCreate(), onStart(), onResume(), etc. It provides an example logging the lifecycle. It defines a fragment as a modular piece of UI/behavior that can be placed in an activity. It discusses combining fragments in different configurations for tablets vs phones. It also covers the fragment lifecycle and provides an example creating two fragments for landscape and portrait orientations.
Fragments allow modularization of activities on larger screens like tablets. A fragment represents a behavior or UI portion and has its own lifecycle callbacks. Fragments can be placed in an activity layout via XML or added dynamically in code. Multiple fragments can be combined in a single activity to build a multi-pane UI. The activity lifecycle influences fragments, and fragments can be retained across configuration changes using setRetainInstance(true).
An Android application is composed of activities, services, and content providers. Activities display user interfaces and are launched by intents. The context provides access to application-wide resources and functionality. Activities have a lifecycle of states like resumed, paused, and stopped that are called back through methods to manage resources. Intents are used to transition between activities within an app or launch other apps' components.
An activity provides a screen for users to interact with an Android application. Activities are organized into a stack and have a lifecycle of states like resumed and paused. To create an activity, you subclass the Activity class and implement callback methods corresponding to lifecycle states like onCreate and onPause. Activities must be declared in the app manifest and can be started with an intent.
Raman Pandey's presentation discusses the basics of Android app development, including:
- Android is an open source operating system for mobile devices based on Linux.
- Java programming knowledge and software like Java JDK, Android SDK, and Android Studio are prerequisites.
- The Android architecture includes layers like applications, application framework, libraries and the Linux kernel.
- Application components, resources, intents, fragments, UI layouts and the emulator are discussed as fundamental concepts.
Fragments allow modular and reusable components in an Android application. They are portions of UI for an activity that have their own lifecycle and can be added or removed during runtime. The key aspects are:
- Fragments were introduced in Android 3.0 but can be used in older versions with the compatibility library.
- Their lifecycle is directly tied to the host activity - pausing/destroying the activity also pauses/destroys fragments.
- They are defined as subclasses of Fragment and implement lifecycle methods like onCreateView to define the UI.
- Fragments can be added to activities declaratively in XML layouts or programmatically using transactions.
Fragments allow modular sections of an activity's UI to be reused across activities and configurations. A fragment must be embedded in an activity and shares its lifecycle. Fragments can be added or removed dynamically at runtime and their transactions can be added to a back stack. Activities can combine multiple fragments to build a multi-pane UI on tablets and reuse fragments across activities on handsets. To create a fragment, subclass Fragment and move code from activities into fragment lifecycle methods.
This document discusses activities, fragments, and events in Android mobile application development. It covers the life cycle of activities, using fragments to customize user interfaces, linking activities with intents, and displaying notifications. Activities provide interfaces for user interaction and have stages like onCreate() and onPause(). Fragments are reusable interface elements that can be placed within activities. Notifications are persistent status bar messages.
Fragments allow modularizing an app's UI into reusable components. A fragment represents a portion of UI within an activity and has its own lifecycle. Multiple fragments can be used within a single activity to create a multi-pane UI or reuse fragments across activities. Key advantages are modularity, ability to reuse fragments, and maintaining a back stack of fragment states. The document discusses implementing fragments in different screen types, writing fragment and activity classes, and including fragments in layouts. It also covers fragment types like ListFragment and DialogFragment and ensuring compatibility by adding the support library.
This document discusses Android fragments and their advantages over traditional activities. Fragments allow for modularity and adaptability in user interfaces across different devices and orientations. They are content controllers that can be added and positioned within activities for navigation. While fragments require more attention to their lifecycles, they optimize apps for various screens and can be reused and combined more easily than separate activities. The document demonstrates fragments' behavior on smartphones and in landscape orientation, and provides code snippets and resources for further learning.
Fragments represent reusable portions of user interface in an activity. An activity can host multiple fragments that the user can navigate between. Fragment transactions allow adding, replacing, and removing fragments within an activity. Fragments can communicate with each other using interfaces to pass data between fragments hosted by the same activity.
[/SUMMARY]
Those who want to be familiar with Android, can easily go through this document. It will help them to learn basics. It is also useful for those who are preparing for cracking android interviews as this document is short and precise.
Android is an open source platform developed by Google and the Open Handset Alliance for mobile devices. It consists of an operating system, middleware, and key applications. The document provides an overview of Android versions from 1.1 to 4.1 Jelly Bean and their market shares. It also discusses installing the Android Development Tools plugin for Eclipse, exploring a sample project's components, and developing applications considering different Android versions. The sample project demonstrates creating layouts, handling button clicks, launching a new activity, and registering activities in the manifest file.
The document discusses working with fragments in Android. It provides an overview of fragments, when to use them, how to manage fragments using FragmentManager and FragmentTransactions, and how to add fragments both statically and dynamically. It also covers fragment operations like adding, removing, replacing fragments as well as using the back stack with fragments. The document includes examples and demos of fragments with activities, action bar navigation, view pagers, and navigation drawers.
Google Plus SignIn : l'Authentification GoogleMathias Seguy
Cette conférence vous expliquera en détail pourquoi mettre en place cette authentification et surtout comment la mettre en place.
Vous découvrirez ainsi:
la console des GoogleService,
comment utiliser l’objet PlusClient et ConnectionResult pour gérer l’identification de votre utilisateur,
comment mettre en place la « magic connexion » et la « manual connexion »,
comment mettre en place cette authentification au sein du cycle de vie de votre application,
comment charger le graphe social de l’utilisateur, faire des posts interactifs et des « application activities »…
Un grand moment pour tous ceux qui se demandent encore quelle est la meilleure stratégie pour authentifier son utilisateur.
Cette conférence s’associe:
d’un tutorial que vous pouvez retrouver sur GitHub: SignInWithGoogleTutorial(https://github.com/MathiasSeguy-Android2EE/SignInWithGoogleTutorial) sur GitHub.
d’une application mettant en place cette authentification que vous pouvez retrouver sur GooglePlay: MyPublicGoogleProfile (https://play.google.com/store/apps/details?id=com.android2ee.project.gplus.signin.publicid&hl=fr).
Et bien sûr la conférence va être disponible sur Android2EE dès le Vendredi 20 au rayon OpenResource\Conférences.
Vous aussi, authentifiez vos utilisateurs, inter-agissez avec eux et simplifiez leur la vie:
En espérant que vous y découvrirez votre bonheur :) .
The document discusses Android application development. It provides an overview of the Android platform, including that it is an open source software stack for mobile devices powered by Linux. It describes the installation of development tools like Eclipse and the Android SDK. It then covers the basic building blocks for Android apps like activities, services, intents, and content providers.
Presented at Big Android BBQ 2015
Hurst Convention Center, Hurst Texas
This talk will cover Fragments in detail by comparing and contrasting them to something we know well, Activities. We will also cover examples and use cases. Fragments: Why, How, and What For? is targeted toward developers who may not have had a lot of experience using Fragments and those who want to understand them better. Why did Google introduce Fragments? Aren’t Activities enough? How do Fragments work? What For? Example and use cases such as Fragment reuse, single pane vs multi-pane, ViewPager, NavigationDrawer and DialogFragment.
The document discusses several new features and APIs in Android 3.0 (Honeycomb) for tablets, including fragments which allow recomposing UI based on factors like screen size, loaders for asynchronously fetching content, an enhanced action bar for navigation and menus, hardware accelerated graphics, and the new holographic UI design. It also questions what some aspects of Android 3.0 may mean for future phone releases and how to detect "tablet-y" systems.
Fragments allow dividing the graphical interface of an activity into independent and reusable modules. A fragment has its own lifecycle and can be dynamically added or removed from an activity during runtime. Communication between a fragment and its activity can occur through interfaces or by accessing the activity from within the fragment. Fragments help create flexible and adaptable user interfaces for different screen sizes and configurations.
This is a basic crash course for android development covers:
Android Studio,Hello World Application,Application Components,Application Resources,User Interface,Good UI,Play Store
This document discusses how to become an expert Android developer using Google technologies. It recommends using Android Studio as the integrated development environment due to its fast tools for building apps. It also recommends using the Android Jetpack architecture components like ViewModel, LiveData, and Room to accelerate development and build robust apps by eliminating boilerplate code. The document also covers other Jetpack components like Data Binding, Navigation, Lifecycles, and Testing to further improve the development process.
This document provides an overview of setting up the development environment for an Android and SWS application. It includes sections on installing Java, Eclipse, the Android SDK and ADT plugin. It also covers creating a sample Android project and describes the SWS API package structure, which includes common, configuration, utility, UI and transaction processing components.
Answer1)Responsive design is the idea where all the developed pag.pdfankitcomputer11
Answer:
1)Responsive design is the idea where all the developed pages are embedded with model,view
and controller in the same page of the design so that it is easy for the user to transfer the data
from model to view and view to model.This also reduces the burden on the server when the user
makes any request all the form elements will not reach the server in responsive design but makes
the specific action element to reach the server and gives the output to the user.
2)Application templates in android involves both the layouts and UI components which are used
to build the design pages of the front end of the page.The common layouts which are used are
Gird Layout,Flow Layout,Relative Layout and UI components such as
listview,gridview,spinner,togglebuttons,radiobuttons,progressbar etc are used in any of the front
end design of the android for application to develop.We use XML for the design of the front end
in design in the application.
Android Application :
Note : Deploy the below files in Eclipse Id or Android Studio and run
MainActivity.java
package com.example.listviewcustom;
import java.io.File;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
/*
String path=\"/storage/sdcard0/sample_images/\";
File f=new File(path);
if(f.exists()){
String[] files=f.list();
ArrayAdapter adapter=new ArrayAdapter(getApplicationContext(),
android.R.layout.simple_spinner_dropdown_item,files );
*/
ListView lView=(ListView)findViewById(R.id.listView1);
lView.setAdapter(new MyAdapter(this));
/*
}else{
Toast.makeText(getApplicationContext(), \"Path is not available ....\",2000).show();
}
*/
}
public void reload(){
ListView lView=(ListView)findViewById(R.id.listView1);
lView.setAdapter(new MyAdapter(this));
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
MyAdapter.java
package com.example.listviewcustom;
import java.io.File;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView.FindListener;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class MyAdapter extends BaseAdapter{
//String path=\"/storage/sdcard0/sample_images/\";
String path=\"/mnt/sdcard/sample_images/\";
File f=new File(path);
String[] files=f.list();
MainActivity activity;
public MyAdapter(MainActivity mActivity){
this.activity=mActivity;
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return files.length;
}
@Override
public Object getItem(int position) {
// TODO Auto-.
An Android application is composed of activities, services, and content providers. Activities display user interfaces and are launched by intents. The context provides access to application-wide resources and functionality. Activities have a lifecycle of states like resumed, paused, and stopped that are called back through methods to manage resources. Intents are used to transition between activities within an app or launch other apps' components.
An activity provides a screen for users to interact with an Android application. Activities are organized into a stack and have a lifecycle of states like resumed and paused. To create an activity, you subclass the Activity class and implement callback methods corresponding to lifecycle states like onCreate and onPause. Activities must be declared in the app manifest and can be started with an intent.
Raman Pandey's presentation discusses the basics of Android app development, including:
- Android is an open source operating system for mobile devices based on Linux.
- Java programming knowledge and software like Java JDK, Android SDK, and Android Studio are prerequisites.
- The Android architecture includes layers like applications, application framework, libraries and the Linux kernel.
- Application components, resources, intents, fragments, UI layouts and the emulator are discussed as fundamental concepts.
Fragments allow modular and reusable components in an Android application. They are portions of UI for an activity that have their own lifecycle and can be added or removed during runtime. The key aspects are:
- Fragments were introduced in Android 3.0 but can be used in older versions with the compatibility library.
- Their lifecycle is directly tied to the host activity - pausing/destroying the activity also pauses/destroys fragments.
- They are defined as subclasses of Fragment and implement lifecycle methods like onCreateView to define the UI.
- Fragments can be added to activities declaratively in XML layouts or programmatically using transactions.
Fragments allow modular sections of an activity's UI to be reused across activities and configurations. A fragment must be embedded in an activity and shares its lifecycle. Fragments can be added or removed dynamically at runtime and their transactions can be added to a back stack. Activities can combine multiple fragments to build a multi-pane UI on tablets and reuse fragments across activities on handsets. To create a fragment, subclass Fragment and move code from activities into fragment lifecycle methods.
This document discusses activities, fragments, and events in Android mobile application development. It covers the life cycle of activities, using fragments to customize user interfaces, linking activities with intents, and displaying notifications. Activities provide interfaces for user interaction and have stages like onCreate() and onPause(). Fragments are reusable interface elements that can be placed within activities. Notifications are persistent status bar messages.
Fragments allow modularizing an app's UI into reusable components. A fragment represents a portion of UI within an activity and has its own lifecycle. Multiple fragments can be used within a single activity to create a multi-pane UI or reuse fragments across activities. Key advantages are modularity, ability to reuse fragments, and maintaining a back stack of fragment states. The document discusses implementing fragments in different screen types, writing fragment and activity classes, and including fragments in layouts. It also covers fragment types like ListFragment and DialogFragment and ensuring compatibility by adding the support library.
This document discusses Android fragments and their advantages over traditional activities. Fragments allow for modularity and adaptability in user interfaces across different devices and orientations. They are content controllers that can be added and positioned within activities for navigation. While fragments require more attention to their lifecycles, they optimize apps for various screens and can be reused and combined more easily than separate activities. The document demonstrates fragments' behavior on smartphones and in landscape orientation, and provides code snippets and resources for further learning.
Fragments represent reusable portions of user interface in an activity. An activity can host multiple fragments that the user can navigate between. Fragment transactions allow adding, replacing, and removing fragments within an activity. Fragments can communicate with each other using interfaces to pass data between fragments hosted by the same activity.
[/SUMMARY]
Those who want to be familiar with Android, can easily go through this document. It will help them to learn basics. It is also useful for those who are preparing for cracking android interviews as this document is short and precise.
Android is an open source platform developed by Google and the Open Handset Alliance for mobile devices. It consists of an operating system, middleware, and key applications. The document provides an overview of Android versions from 1.1 to 4.1 Jelly Bean and their market shares. It also discusses installing the Android Development Tools plugin for Eclipse, exploring a sample project's components, and developing applications considering different Android versions. The sample project demonstrates creating layouts, handling button clicks, launching a new activity, and registering activities in the manifest file.
The document discusses working with fragments in Android. It provides an overview of fragments, when to use them, how to manage fragments using FragmentManager and FragmentTransactions, and how to add fragments both statically and dynamically. It also covers fragment operations like adding, removing, replacing fragments as well as using the back stack with fragments. The document includes examples and demos of fragments with activities, action bar navigation, view pagers, and navigation drawers.
Google Plus SignIn : l'Authentification GoogleMathias Seguy
Cette conférence vous expliquera en détail pourquoi mettre en place cette authentification et surtout comment la mettre en place.
Vous découvrirez ainsi:
la console des GoogleService,
comment utiliser l’objet PlusClient et ConnectionResult pour gérer l’identification de votre utilisateur,
comment mettre en place la « magic connexion » et la « manual connexion »,
comment mettre en place cette authentification au sein du cycle de vie de votre application,
comment charger le graphe social de l’utilisateur, faire des posts interactifs et des « application activities »…
Un grand moment pour tous ceux qui se demandent encore quelle est la meilleure stratégie pour authentifier son utilisateur.
Cette conférence s’associe:
d’un tutorial que vous pouvez retrouver sur GitHub: SignInWithGoogleTutorial(https://github.com/MathiasSeguy-Android2EE/SignInWithGoogleTutorial) sur GitHub.
d’une application mettant en place cette authentification que vous pouvez retrouver sur GooglePlay: MyPublicGoogleProfile (https://play.google.com/store/apps/details?id=com.android2ee.project.gplus.signin.publicid&hl=fr).
Et bien sûr la conférence va être disponible sur Android2EE dès le Vendredi 20 au rayon OpenResource\Conférences.
Vous aussi, authentifiez vos utilisateurs, inter-agissez avec eux et simplifiez leur la vie:
En espérant que vous y découvrirez votre bonheur :) .
The document discusses Android application development. It provides an overview of the Android platform, including that it is an open source software stack for mobile devices powered by Linux. It describes the installation of development tools like Eclipse and the Android SDK. It then covers the basic building blocks for Android apps like activities, services, intents, and content providers.
Presented at Big Android BBQ 2015
Hurst Convention Center, Hurst Texas
This talk will cover Fragments in detail by comparing and contrasting them to something we know well, Activities. We will also cover examples and use cases. Fragments: Why, How, and What For? is targeted toward developers who may not have had a lot of experience using Fragments and those who want to understand them better. Why did Google introduce Fragments? Aren’t Activities enough? How do Fragments work? What For? Example and use cases such as Fragment reuse, single pane vs multi-pane, ViewPager, NavigationDrawer and DialogFragment.
The document discusses several new features and APIs in Android 3.0 (Honeycomb) for tablets, including fragments which allow recomposing UI based on factors like screen size, loaders for asynchronously fetching content, an enhanced action bar for navigation and menus, hardware accelerated graphics, and the new holographic UI design. It also questions what some aspects of Android 3.0 may mean for future phone releases and how to detect "tablet-y" systems.
Fragments allow dividing the graphical interface of an activity into independent and reusable modules. A fragment has its own lifecycle and can be dynamically added or removed from an activity during runtime. Communication between a fragment and its activity can occur through interfaces or by accessing the activity from within the fragment. Fragments help create flexible and adaptable user interfaces for different screen sizes and configurations.
This is a basic crash course for android development covers:
Android Studio,Hello World Application,Application Components,Application Resources,User Interface,Good UI,Play Store
This document discusses how to become an expert Android developer using Google technologies. It recommends using Android Studio as the integrated development environment due to its fast tools for building apps. It also recommends using the Android Jetpack architecture components like ViewModel, LiveData, and Room to accelerate development and build robust apps by eliminating boilerplate code. The document also covers other Jetpack components like Data Binding, Navigation, Lifecycles, and Testing to further improve the development process.
This document provides an overview of setting up the development environment for an Android and SWS application. It includes sections on installing Java, Eclipse, the Android SDK and ADT plugin. It also covers creating a sample Android project and describes the SWS API package structure, which includes common, configuration, utility, UI and transaction processing components.
Answer1)Responsive design is the idea where all the developed pag.pdfankitcomputer11
Answer:
1)Responsive design is the idea where all the developed pages are embedded with model,view
and controller in the same page of the design so that it is easy for the user to transfer the data
from model to view and view to model.This also reduces the burden on the server when the user
makes any request all the form elements will not reach the server in responsive design but makes
the specific action element to reach the server and gives the output to the user.
2)Application templates in android involves both the layouts and UI components which are used
to build the design pages of the front end of the page.The common layouts which are used are
Gird Layout,Flow Layout,Relative Layout and UI components such as
listview,gridview,spinner,togglebuttons,radiobuttons,progressbar etc are used in any of the front
end design of the android for application to develop.We use XML for the design of the front end
in design in the application.
Android Application :
Note : Deploy the below files in Eclipse Id or Android Studio and run
MainActivity.java
package com.example.listviewcustom;
import java.io.File;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
/*
String path=\"/storage/sdcard0/sample_images/\";
File f=new File(path);
if(f.exists()){
String[] files=f.list();
ArrayAdapter adapter=new ArrayAdapter(getApplicationContext(),
android.R.layout.simple_spinner_dropdown_item,files );
*/
ListView lView=(ListView)findViewById(R.id.listView1);
lView.setAdapter(new MyAdapter(this));
/*
}else{
Toast.makeText(getApplicationContext(), \"Path is not available ....\",2000).show();
}
*/
}
public void reload(){
ListView lView=(ListView)findViewById(R.id.listView1);
lView.setAdapter(new MyAdapter(this));
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
MyAdapter.java
package com.example.listviewcustom;
import java.io.File;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView.FindListener;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class MyAdapter extends BaseAdapter{
//String path=\"/storage/sdcard0/sample_images/\";
String path=\"/mnt/sdcard/sample_images/\";
File f=new File(path);
String[] files=f.list();
MainActivity activity;
public MyAdapter(MainActivity mActivity){
this.activity=mActivity;
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return files.length;
}
@Override
public Object getItem(int position) {
// TODO Auto-.
Android is an open source operating system used for mobile devices like smartphones and tablets. It is developed by Google and managed by the Open Handset Alliance. The Android manifest file contains important configuration settings for Android applications, including supported SDK versions, required permissions, application components and more. It determines how the application interacts with the operating system.
Android activity, service, and broadcast recieversUtkarsh Mankad
The document provides an overview of creating a basic "Hello World" Android application. It discusses creating a new Android project, the typical project file structure including the src, res, assets, and AndroidManifest.xml files. It also summarizes the purpose of activities, services, and broadcast receivers as core Android application components.
Prajakta Dharmpurikar's presentation discusses fundamentals of Android development. It covers basics like what Android is, its software stack and versions. It explains core application components like activities, services, broadcast receivers and content providers. It also discusses intents, the Android manifest file and building a simple "Hello World" Android app. The presentation provides an overview of creating an Android project structure and running an app.
The document discusses Android activities and fragments. It defines an activity as representing a single screen with a user interface. It notes that an app may have multiple activities for different screens like email lists, compose, and read. It then discusses the activity lifecycle and callbacks like onCreate(), onStart(), onResume(), etc. It provides an example logging the lifecycle. It defines a fragment as a modular piece of UI/behavior that can be placed in an activity. It discusses combining fragments in different configurations for tablets vs phones. It also covers the fragment lifecycle and provides an example creating two fragments for landscape and portrait orientations.
The document discusses Android activities and fragments. It defines an activity as representing a single screen with a user interface. It notes that an app may have multiple activities for different screens like email lists, compose, and read. It then discusses the activity lifecycle and callbacks like onCreate, onStart, onResume, etc. It provides an example to log the lifecycle methods.
The document then defines a fragment as a modular section of an activity, like a sub-activity, that has its own layout and lifecycle. It notes fragments allow dividing the screen between different parts. It provides an example of how two fragments could be used together in landscape mode but separated in portrait mode. It discusses the fragment lifecycle callbacks as
The document discusses activities and fragments in Android. It defines an activity as representing a single screen with a user interface. Activities have a lifecycle defined by callback methods like onCreate(), onStart(), onResume(), etc. Fragments allow dividing the UI of an activity and are like sub-activities with their own layout and lifecycle. Fragments were introduced later than activities to allow multiple modular UI components within a single activity.
Android is a software stack that includes an operating system, middleware and key applications for mobile devices. It uses the Java programming language and includes features like application frameworks, SQLite for storage, and support for common media formats. The Android architecture consists of applications, an application framework, libraries and services, the Android runtime and the Linux kernel. Activities are the basic building blocks of Android apps and have a defined lifecycle of states they move through as the user interacts with the app.
This document provides an overview of best practices for Android development. It discusses topics such as UI design, including layouts and styles; using the action bar for search and progress indicators; accessibility; network connections; asynchronous tasks and services; fragments and navigation patterns; geolocation and performance; dependency injection; and recommended tools and libraries. The document provides code snippets and links to the Android developer documentation for further information on these topics.
This document provides an overview of the key components and architecture of the Android operating system. It discusses that Android is built on the Linux kernel and uses Java for application development. It also summarizes the main components of the Android software stack including the libraries, runtime environment, application framework, and applications. Additionally, it describes some important Android concepts like activities, intents, broadcast receivers, content providers, and services.
This document provides a tutorial on Android application development. It begins with an introduction to Android and its architecture. It then discusses key Android application components like activities, services, broadcast receivers and content providers. The document also covers installing the Android SDK and creating a basic Android project in Eclipse. It includes two programming tutorials - one on tracking location using GPS and Google Maps, and another on downloading content from the internet. The tutorials demonstrate how to access device sensors, handle location updates and make HTTP requests in an Android app.
The document provides an overview of new features in Android Honeycomb (3.0) and Ice Cream Sandwich (4.0), including:
1) New UI metaphors like the ActionBar and onscreen adaptive menus.
2) Spec hardware changes like the lack of hard buttons on newer devices.
3) A new "Holographic" look and feel with glows, depth lines, and 3D transitions.
4) New APIs like Fragments, the ActionBar, enhanced widgets/notifications, drag and drop, peer-to-peer networking via NFC Android Beam and WiFi Direct.
This document discusses native Android development practices and provides an overview of using Spring for mobile web applications and Android development. It covers Spring Mobile features like device detection and site preference management. It then introduces basic Android development concepts like activities, services, and manifest registration. It demonstrates a simple "Hello World" Android activity and discusses Android lifecycles. Finally, it discusses using Maven for Android projects.
The document discusses key concepts in Android application development including:
- Android applications are developed using Java and compiled into .apk files that run within the Dalvik virtual machine. Each app runs as an isolated "user" with unique permissions.
- The main components of Android apps are Activities, Services, Content Providers, and Broadcast Receivers which handle interfaces, background tasks, data management and system-wide notifications.
- Apps are developed using a combination of XML layouts and Java code, with activities rendering layouts and adding behavior through listeners and callbacks. Common tasks like displaying text, handling clicks, and text-to-speech are demonstrated.
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxEduSkills OECD
Iván Bornacelly, Policy Analyst at the OECD Centre for Skills, OECD, presents at the webinar 'Tackling job market gaps with a skills-first approach' on 12 June 2024
Gender and Mental Health - Counselling and Family Therapy Applications and In...PsychoTech Services
A proprietary approach developed by bringing together the best of learning theories from Psychology, design principles from the world of visualization, and pedagogical methods from over a decade of training experience, that enables you to: Learn better, faster!
Main Java[All of the Base Concepts}.docxadhitya5119
This is part 1 of my Java Learning Journey. This Contains Custom methods, classes, constructors, packages, multithreading , try- catch block, finally block and more.
2. CONTENTS
Introduction
Android Life Cycle
Activity
Fragment
Layout
Navigation Drawer
Recycler view
Shared preference
Api integration
3. INTRODUCTION
HISTORY OF ANDROID
Android Inc.founded in Palo Alto,california ,united states in October
2003 by Andy Rubin.(Rich Miner, Nick sears and Chris white)
WHAT IS ANDROID?
It is a open source software platform and operating system for mobile
devices , Based on the Linux kernel . Developed by Google and later the
Open Handset Alliance (OHA).
5. Android version history
Code name Version no. Release date API Level
No codename 1.0 September 23, 2008 1
No codename 1.1 February 9, 2009 2
Cupcake 1.5 April 27, 2009 3
Donut 1.6 September 15, 2009 4
Eclair 2.0 – 2.1 October 26, 2009 5-7
Froyo 2.2 – 2.1 May 20, 2010 8
Gingerbread 2.3 – 2.3.7 December 6, 2010 9-10
Honeycomb 3.0 – 3.2.6 February 22, 2011 11-13
Ice Cream Sandwich 4.0 – 4.0.4 October 18, 2011 14-15
Jelly Bean 4.1 – 4.3.1 July 9, 2012 16-18
KitKat 4.4 – 4.4.4 October 31, 2013 19-20
Lollipop 5.0 - 5.1.1 November 12, 2014 21-22
Mashmallow 6.0 – 6.0.1 October 5, 2015 23
Nougat 7.0 – 7.1.2 August 22, 2016 24-25
Oreo 8.0 August 21, 2017 26
6. ANDROID LIFE CYCLE
The steps that an application goes through from starting to finishing
onCreate()
onRestart
onStart()
onResume()
onStop()
onPause()
onDestroy
7.
8. ANDROID LIFE CYCLE
onCreate() - Called before the first components of the application starts.
onRestart - Called after your activity has been stopped, prior to it being
started again.
onStart() – Called when the activity is becoming visible to the user.
onResume() - Called if the activity get visible again.
onStop() - Called once the activity is no longer visible.
onPause() - Called once another activity gets into the foreground.
onDestroy - The final call you receive before your activity is destroyed.
9. ACTIVITY
Basic component of most applications
Most applications have several activities that start each other as needed
Each is implemented as a subclass of the base Activity class
The content of the window is a view or a group of views
Example of views: buttons, text fields, scroll bars, menu items, check boxes,
etc.
An activity is started by Context.startActivity(Intent intent) or
Activity.startActivityForResult(Intent intent, int RequestCode)
10. package com.twixt.uaeexportdirectory.view.activity;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
/**
* @author Pranav Ashok on 30-09-2017.
*/
public class Activity extends AppCompatActivity{
@Override
public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
super.onCreate(savedInstanceState, persistentState);
setContentView(R.layout.activity_xml);
}
}
ACTIVITY
11. FRAGMENT
About Fragments
New in Android 3.0 (Honeycomb, API 11)
Intended to reuse layouts between tablets and phones But usable for many
more...
A fragment is a modular section of an activity, which has its own lifecycle.
A fragment's lifecycle is directly affected by the host activity's lifecycle
Activity paused: fragments paused
Activity destroyed: fragments destroyed
Activity running: fragments can have different states
13. FRAGMENT LIFECYCLE
onAttach() :This method will be called first, even before onCreate(), letting
us know that your fragment has been attached to an activity.
onCreate() : The system calls this when creating the fragment.
onCreateView() : The system calls this when it's time for the fragment to
draw its user interface for the first time.
onViewCreated() : This will be called after onCreateView().
onPause() : The system calls this method as the first indication that the user
is leaving the fragment (though it does not always mean the fragment is being
destroyed).
onDestroyView() : It’s called before onDestroy().
14. package com.twixt.uaeexportdirectory.view.activity;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
/**
* @author Pranav Ashok on 30-09-2017.
*/
public class Activity extends AppCompatActivity{
@Override
public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle
persistentState) {
super.onCreate(savedInstanceState, persistentState);
setContentView(R.layout.activity_xml);
//type your code here
}
}
FRAGMENT
getFragmentManager().beginTransaction()
.add(R.id.activity_xml, new YourFragment(), Activity.class.getName())
.commit();
15. package com.twixt.uaeexportdirectory.view.activity;
import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.xtronlabs.uaeexportdirectory.R;
/**
* @author Pranav Ashok on 30-09-2017.
*/
public class YourFragment extends Fragment{
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle
savedInstanceState) {
View view=inflater.inflate(R.layout.your_fragment_xml,container,false);
return view;
}
}
FRAGMENT
16. LAYOUT
What is a Layout?
Your layout is the architecture for the user interface in an Activity.
It defines the layout structure and holds all the elements that appear
to the user.
How to declare a Layout?
Option #1: Declare UI elements in XML
Option #2: Instantiate layout elements at runtime
22. RECYCLERVIEW
This widget is a container for displaying large data sets that can be scrolled
very efficiently by maintaining a limited number of views.
You need to include gradle file in the dependencies (build.gradle module)
Compile 'com.android.support:recyclerview-v7:25.+'
24. RECYCLERVIEW
public Rv_Adapter rv_Adapter;
public RecyclerView r_v;
Rv_Adapter = new Rv_Adapter (getActivity());
r_v.setAdapter(rv_Adapter);
r_v.setLayoutManager(new LinearLayoutManager(getActivity()));
//in main xml page
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_id"
android:layout_width="match_parent"
android:layout_height="wrap_content“/>
25.
26. SHARED PREFERENCE
The shared preference is a class that provide a storage area to store a small
amount of temporary data you can save.
Shared preference in Android are used to keep track of application and user
preferences.
Android applications can store data in application preferences.
In any application, there are default preferences that can accessed through
the PreferenceManager instance and its related
method getDefaultSharedPreferences(Context)
With the SharedPreference instance one can retrieve the int value of the any
preference with the getInt(String key, intdefVal).
We can modify the SharedPreference instance in our case using the <br
/>edit() and use the putInt(String key, intnewVal)
28. API INTEGRATION
Connect to the Network
<uses-permission android:name="android.permission.INTERNET" />
Manage Network Usage
Minimize the amount of sensitive or personal user data that you transmit
over the network.
Parsing XML Data
Integrate data in your xml fields
29. API INTEGRATION
Things to remember before integrating
In manifests
<uses-permission android:name="android.permissionINTERNET" />
In build.gradle(Module:app)
packagingOptions {
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
31. API INTEGRATION
Create an Interface Class
public interface Interface_all_links_here {
@GET("aps_api/get_all_ads")
Call<Api_Responce[]> getDATA();
}
32. API INTEGRATION
Create an Interface Class for processor responce
public interface ProcessResponceIntrphase<T> {
void processResponce(T responce);
}
34. API INTEGRATION
Create an Rrequest Class for Api
public class Api_Request extends AbstractRequest<Api_Responce[]> {
public Api_Request(Context context,
ProcessResponceIntrphase<Api_Responce[]> responcec_Handeler) {
super(context, responcec_Handeler);
}
public void get_Data() {
Call<Api_Responce[]> call = _interface.getDATA();
call.enqueue(this);
}
}
public class Adapter_for_rv extends RecyclerView.Adapter<Adapter_for_rv.ViewHolder> {
Context context;
public Adapter_for_rv(Context con) {
context = con;
}
@Override
public Adapter_for_rv.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
LayoutInflater layoutInflater = LayoutInflater.from(context);
return new ViewHolder(layoutInflater.inflate(R.layout.rvlayout, parent, false));
}
@Override
public void onBindViewHolder(Adapter_for_rv.ViewHolder holder, int position) {
//code -> action to be done
}
@Override
public int getItemCount() {
return length;
}
public class ViewHolder extends RecyclerView.ViewHolder {
// declarations
public ViewHolder(final View itemView) {
super(itemView);
// finding declared fields and actions here
}
}
}