USB Host API’s in the android.hardware.usb Android by Manasi Dharne - April 26, 2019April 30, 20190 When Android-powered device is in USB host mode, it acts as the USB host, powers the bus, and enumerates connected USB devices. Manifest Requirements Following things need to be add in Manifest file: <uses-feature> element that declares that your application uses the android.hardware.usb.host feature.Set the minimum SDK of the application to API Level 12 or higher. add <intent-filter>(USB_DEVICE_ATTACHED) and <meta-data> .<meta-data> points to an xml file which contains vendor-id,produt-id,class,subclass,protocol.to give information <usb-device> tag can be used. <manifest ...> <uses-feature android:name="android.hardware.usb.host" /> <uses-sdk android:minSdkVersion="12" /> ... <application> <activity ...> ...
Login App in Android HelloWorld by Manasi Dharne - March 27, 2019April 11, 20190 To Create any application in android we have to deal with three files: AndroidManifest.xmlactivity_main.xmlMainActivity.java AndroidManifest.xml: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.login.login"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" />
Navigation from one screen to another screen in android HelloWorld by Manasi Dharne - March 27, 2019April 11, 20190 Functionality: How to interact with activity,when a button is clicked,navigate from current screen(current activity) to another screen(another activity). Activity: In android,an activity is representing a single screen.Most applications have multiple activities to represent different screens.for example,one activity to display a list of the application settings,another to display application status. To Create any application in android we have to deal with three files: AndroidManifest.xmlactivity_main.xmlMainActivity.java AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.nav.navigation" > <application android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" android:label="@string/title_activity_main" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category
Calculator App in Android HelloWorld by Manasi Dharne - March 27, 2019March 28, 20190 Here ,we are creating simple and basic functions calculator App. This app can help you to understand the layouts, buttons and action handling. To create this app we need to use different widgets such as TextView, button, EditText etc.This app is able to perform following basic four mathematical functions : AdditionSubtractionMultiplicationDivision To Create any application in android we have to deal with three files: AndroidManifest.xmlactivity_main.xmlMainActivity.java AndroidManifest.xml The AndroidManifest.xml contains information of your package, including components of the application such as activities, services, broadcast receivers, content providers etc. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.calculator.calculator2"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name"
USB Communication HelloWorld by Manasi Dharne - March 26, 2019March 26, 20190 About Android USB Android supports USB devices through two modes: Android Accessory: In this mode external USB device acts as host.Android Host: In this mode Android Device acts as host and powers the external device. Manifest File for USB connection We want to be notified when an external USB device is attached to the Android device.This can be done adding a new intent filter entry to the Activity that should be started by the system when a USB device is plugged in. <activity ....... <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter> <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
Display selected item of ListView using toast in android HelloWorld by Manasi Dharne - March 11, 2019November 20, 20192 ListView In Android, List of scroll-able items can be displayed using ListView. Users can select any list item by clicking on it. Problem Statement: Develop an application to create list of fruits using ListView and display selected fruit of ListView using toast. How to get the selected item from ListView? Several Ways to create ListView: There 2 ways to create ListView: we can assign ListView by giving values in main.xml.we can assign values in string.xml. Sample Code: Here is sample code for ListView using toast in android, Created two files to develop an application. Layout file(activity_main.xml):This file contains code to design an GUI of an application. In this we have used widget ListView to display list and TextView to display text on lists.Activity file(MainActivity.java): This file contains
Hello World in android studio using activity,service & broadcastReceiver HelloWorld by Manasi Dharne - March 6, 2019April 11, 20190 Problem Statement: Printing Hello World text using activity,service and broadcast receiver. This program demonstrates how to call any activity from service and service from broadcast receiver. The application starts from broadcast receiver then control goes to service and service call activity to print "Hello World". Several ways To create an application: LocalBroadcastManager:This can be used ,If you want to send broadcasts to your application.BroadcastReceiver:This can be used,If you want to send broadcasts across applications. About Code: I have created 3 java classes namely broadcast,MyService,MyActivity. broadcast.java :This class inherits BroadcastReceiver class and contains method onReceive(Context context, Intent intent) to create an intent and to call startService() method.MyService.java:This class inherits Service class and contains method onBind(Intent intent) to create intent and to call startActivity().MainActivity.java:This class inherits Activity
Android Architecture HelloWorld by Manasi Dharne - February 26, 2019February 26, 20190 Android architecture is the structure of how android actually works in low level. There are several layers that shows how processes works on Android. Android architecture includes Android Run-time Applications, Native C and C++ libraries that were used to build Android. Some other frameworks on the Top of Linux kernel which connects hardware to the software. Architecture Linux kernel At the bottom of the layers is Linux.This provides a level of abstraction between the device hardware and it contains all the essential hardware drivers like camera, keypad, display etc. Also, the kernel handles all the things that Linux is really good at such as networking and a vast array of device drivers. For example, the Android Run-time (ART) relies on the Linux
Working With Android Studio HelloWorld by Manasi Dharne - February 25, 2019February 25, 20190 Android Studio is the official integrated development environment (IDE) for Google's Android operating system, built on JetBrains' IntelliJ IDEA software and designed specifically for Android development.It is available for download on Windows, macOS and Linux based operating systems. Android Studio Android App Module It Provides a container for your app's source code, resource files, and app level settings such as the module-level build file and Android Manifest file. When you create a new project, the default module name is "app".In the Create New Module window, Android Studio offers the following types of app modules: Phone & Tablet ModuleWear OS ModuleAndroid TV ModuleGlass Module AppModule Project Files: Within each Android app module, files are shown in the following groups: manifests:Contains the AndroidManifest.xml file.java:Contains the Java source code files, separated by package names, including JUnit
App Components HelloWorld by Manasi Dharne - February 25, 2019February 25, 20190 App components are an entry point through which the system or a user can enter into your app. Components There are four different types of app components: ActivitiesServicesBroadcast receiversContent providers 1.Activities Android Activity is Front end view of an app.It represents a single screen with a user interface. For example, an whatsapp app might have one activity that shows a list of all contacts, another activity to show all chats, and another activity to update status. Although the activities work together to form a cohesive user experience in the whatsapp app, each one is independent of the others. Intent: An Intent is a simple message object that is used to communicate between android components such as activities, content providers, broadcast receivers and services. Intents are also