Posts

Showing posts with the label android

Android Detect Internet Connection Status

Image
In this article you will learn how to detect internet connection status manually and automatically. Using broadcast receiver, your app will be automatically notified when there is a change in network connection. This provides easy way do any changes in the app like hiding few button (like WhatsApp hides send, upload icon when there is not internet), navigation user to another screen, or just show a Snackbar message. Creating New Project 1 . Create a new project in Android Studio from File ⇒ New Project . When it prompts you to select the default activity, select Blank Activity and proceed. 2 . Create a class named ConnectivityReceiver.java and extend it from BroadcastReceiver . This is a receiver class which will be notified whenever there is change in network / internet connection. ConnectivityReceiver.java   package com.example.bentaherghassen.androiddetectinternetconnection; /** * Created by bentaherghassen on 11/6/2017. */ import android. conte...

Android How to Apply Material Design Theme

Image
Following steps will help you applying the material design theme to your app. 1 . In Android Studio, go to File ⇒ New Project and fill all the details required to create a new project. When it prompts to select a default activity, select Blank Activity and proceed. 2 . Open build.gradle and add android design support library com.android.support:design:23.0.1 . This step is necessary if you are adding any android design support library components to your app. build . gradle dependencies { compile fileTree(dir : 'libs', include : ['* . jar']) compile 'com . android . support : appcompat - v7 : 23.0 . 1 ' compile 'com . android . support : design : 23.0 . 1 ' } 3 . Open colors.xml located under res ⇒ values and add the below color values. colors.xml <? xml version = "1.0" encoding = "utf-8" ?> < resources > < color name = "colorPrimary" > #125688 </ color > ...

LED control using Arduino and Android ( part 3 : Arduino code )

Image
In this Part we going see Arduino Code . // on Github Ghassen Ben Taher .©

LED control using Arduino and Android ( part 2 : Android apk )

Image
In this Part we going see step by step how to making android apk. Ghassen Ben Taher .© Android: New Project Open Android Studio and create a new Project:  File > New Project. A pop up Windows will appear. Change the Application Name and Company Name:   Click next to choose the target of the application. Click next and choose a Blank Activity. Click next and rename the Activity Name to “DeviceList”. Now click “finish” and the Project will be create Android: Layout Part 1. When the build is finished, a “Hello world!” screen will be open ,  to create the layout of the apk, we need to add : TextView to display some hint to the user; Click twice the TextView to change the text. A box will appear: Text = The text to be displayed. Id = the id of this widget. Button to show the paired devices. Click twice the Button to change the text. A box will appear: Text = The text to be displayed. Id = the id of this widget. ListView ...

LED control using Arduino and Android ( part 1 )

Image
For  Arduino  you will need :  Arduino Uno LM35 ( or other sensor) Resistors 300 Ω (3x) Jumpers Bluetooth Module (HC-06/other) Android phone  SSP Bluetooth Apk (unWiref Lite ) C programming skills And for Android  before start coding you must : Download Android studio IDE and update Java ( or Eclipse IDE , it’s almost the same) Jaa and C programming skills will help This tutorial will not expalin Java programming The apl will send commands to turn on/off the led and control the brightness. See you on part 2 of this tutorial Ghassen ben Taher .©