Posts

Sign-on by using Google OAuth2

Image
Sign-on by using Google OAuth2 Popular OAuth2 services are available in mobile applications. such as; Login the mobile applications by using Facebook, Google, Twitter etc accounts. In this post, I am gonna explain how to Login a mobile application by using Gmail/Google+ credentials. Step 1: First, we should get the SHA1 fingerprint id from our Android Studio. So, Open the terminal in Mac or Linux (In Windows, open your DOS or command prompt) then follow those below steps in a sequential order. cd ~/.android then  keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android . . Certificate fingerprints: MD5:  B3:13:5C:40:63:7B:54:2C:95:57:24:1B:A2:CC:D7:C8 SHA1: 2C:32:8D:E3:B2:B1:33:D3:25:C2:35:F6:96:71:2C:48:98:39:98:2B SHA256: 9D:00:90:01:31:F9:77:8C:00:F1:3C:74:C6:1B:72:0F:3A:B3:93:6A:6E:F1:F3:0E:64:0F:A5:01:76:F0:63:70 Signature algorithm name: SHA256withRSA Ver...

Using AdMob feature in android applications

Using AdMob feature in android applications Hope, All of you heard about AdMob. It's an advertisement based Google product, used to earn money by displaying ads in android applications. What is AdMob? answer How does AdMob work? answer I hope, you got the basic understanding about AdMob, Now I am going explain how we can integrate this feature into a mobile app. Before starting this implementation, we should get to know about the type of Ads which we can display. Banner Ads: Basically it is used to show an ad in a small portion of the application while we are using other UIs like activity/Fragment, also it won't interrupt a user's flow because it is always displayed the bottom of a particular app screen. Interstitial Ads: Basically it's used to display ads on the whole screen of the application for a certain time period with a close button. The particular app developer should decide when it should be displayed while users accessing the application. Nat...

Creating JSON REFS service by using Spring MVC

Image
Creating JSON REFS service by using Spring MVC In this post, I am going to explain how to create a JSON Webservice by using Spring MVC. 1. Eclipse/ Spring Tool Suite 2. Apache Tomcat 8 You have to create a maven project in Eclipse and define artifact id and group id. Then, add all the dependencies in pom.xml, Here you can see the mandatory dependencies has to be included.  I have been used jackson-core and jackson-databind dependencies. (It's available inside Maven artifact) Then you have to add annotation-driven and component-scan in web.xml Then you can define a method inside the controller class. Here @ResponseBody is used to generate the JSON response in the browser. The below method is responsible for creating a JSON web service. Then Run your application in a web server (Tomcat) or Hit the below URL in the browser. http://localhost:<port>/carservice /carservice - It should be matched with controller method. @...

Programmatically turn ON/OFF NFC in Android

 Programmatically t urn ON/OFF NFC in Android I hope most of you know about NFC (Near Field Communication). It's an innovative version of RFID to read and write a small chunk of information by using the electromagnetic field. More information:  http://developer.android.com/guide/topics/connectivity/nfc/index.html In this post, I am going to explain how to turn ON/OFF NFC by using the android APIs. Google has some restrictions on Nfc power on/off for developers. Obviously, we know it is a user feature to turn on/off by android system setting menu. Follow the below steps: The device should be a rooted device or system application acceptable device. The developer needs to be accessed to handle power ON/OFF API by Java reflection. The application should have NFC permission as well as writing secure setting permission. We need to specify all below permissions in AndroidManifest.xml < uses-permission android :name= "android.permission.NFC" />...

Thread in Java - 01

Thread in Java - 01 A thread is a separate flow of execution, each execution is having a separate job during the execution. We can define a thread by extending java.lang.Thread class and implementing Runnable interface. Thread scheduler is part of JVM, It's responsible for scheduling Threads. That's if multiple threads are waiting to get the chance of execution, this execution order is decided by Thread scheduler. We can not expect an exact algorithm is followed by thread scheduler. It's varied from JVM to JVM, Hence we can not expect thread execution order under an exact output. Creating and starting a thread In this post, I am going to explain how to create a thread by using Thread class, how to start this created thread, also analyze possible cases. public class MyThread extends Thread {     @Override     public void run() {         for ( int i = 0; i < 10; i ++) {             ...

Virtual Machines

Virtual Machines The virtual machine is a software simulation of a machine It can be acting like a physical machine. We can categories the virtual machines like, Hardware-based virtual machines Software-based virtual machines What is a Hardware-based virtual machine? Basically, all hardware based virtual machines are called hardware/ system based virtual machine. It's providing several logical systems on the same computer with strong isolation from each other. E.g:  KVM (Kernal-based Virtual Machine) for Linux and UNIX system VMware (http://www.vmware.com) Virtual box (www.virtualbox.org) Cloud Computing: Nowadays lot of hardware cloud computing providers. The main advantage of hardware-based cloud computing is effective utilization of hardware resources. What is a Software-based virtual machine? The all software based virtual machines are called Software/Application/Process based virtual machines. It's acting as runtime engine which is prov...

Setup to execute Apache Spark in Cloudera

Image
Setup to execute Apache Spark in Cloudera Before proceeding the below steps, we should install the Cloudera and be using it by a VMware player. The Cloudera has included Hadoop, Spark, Java, Eclipse and all required libraries. Please refer my previous post to setup the Hadoop:                http://ranjithdroid.blogspot.com/2015/09/setup-for-mapreduce-program-with.html 1. Create a Maven project in eclipse 2. Edit the pom.xml with required spark dependencies. < dependencies >   < dependency >     < groupId > org.apache.spark </ groupId >     < artifactId > spark-core_2.10 </ artifactId >     < version > 1.2.0 </ version >   </ dependency > </ dependencies > < build >   < plugins >     < plugin >       < groupId > org.apache.maven.plugins <...