Android Training in Pune

Parcelable Vs Serializable

Android Tutorials

Android Tutorials

Objectives :

  • What is Parcelable?
  • What is Serializable?
  • What are the differences between Parcelable and Serializable?
  • Explain : Parcelable Vs. Serializable
  • What is Parcelable and Serializable in Android?

 

Parcelable Vs. Serializable

Parameter

Parcelable  Serializable
What is it? Google developped Parcelable for better performance on android Serializable is a standard Java interface
Purpose For marshaling and unmarshaling Java objects For marshaling and unmarshaling Java objects
Package android.os java.io
Speed 10 times Faster than Serializable because it is optimized for usage on android development Slower than Parcelable
Implementation Time Requires more time than Serializable Requires very less time as compared to Parcelable
Degree of Implementation Difficult Easier than Parcelable
Memory Less temporary objects Serializable interface create a lot of temporary objects and cause quite a bit of garbage collection
Use with Intent Parcelable array can be pass via Intent in android

Cannot be used with Intent

 

How to spoof or fake GPS location in Marshmallow?

Android Tutorials

Android Tutorials

Objectives :

  • How to spoof GPS location in Marshmallow?
  • How to fake GPS location in Marshmallow?

To spoof / fake GPS location in Marshmallow follow the steps below :

  1. Go to “Settings”
  2. Go to “About phone”
  3. Scroll to the bottom until you see Build Number.
  4. Repeatedly tap it until you unlock “Developer options”
  5. Go back to “Settings”
  6. Right above “About phone”, you will now see “Developer options”.
  7. Look for “Select mock location app”
  8. Click on this to select the app you use to GPS spoof.

 

Subscribe blog for more updates.

Passing data between activities in Android

Objective :

  • Passing data between activities in Android
  • Passing multiple data between activities in Android
  • Passing array between activities in Android
  • Passing ArrayList between activities in Android
  • Passing ArrayList to another activity in Android
  • Sending data via Intent in Android
  • Sending multiple data via Intent in Android
  • Sending array between activities in Android
  • Sending ArrayList between activities in Android
  • Sending ArrayList to another activity in Android
  • Sending data via Intent and Bundle in Android
  • Sending multiple data via Intent and Bundle in Android
  • Passing array between activities in Android using Intent and Bundle
  • How to pass array to another activity in Android?
  • How to pass array between activities in Android?
  • How to pass data to another activity in Android?
  • How to pass data to activity in Android?
  • How to pass data to between activities in Android?
  • How to pass ArrayList to another activity in Android?
  • How to pass ArrayList between activities in Android?

 

Code for passing data between activities in Android :

ActivityOne.java

[sourcecode lang=”java”]

String value = "Hello!";
Intent in = new Intent(this,ActivityTwo.class);
in.putExtra("Key", value);
startActivity(in);

[/sourcecode]

ActivityTwo.java

[sourcecode lang=”java”]

Bundle bundle = getIntent().getExtras();
String valueReceived = bundle .getString("Key");

[/sourcecode]

 

Code for passing multiple data or values between activities in Android :

Method 1 : Using Intent to pass data and Bundle to extract data between activities in Android

ActivityOne.java

[sourcecode lang=”java”]

String value1 = "Hello!";
String value2 = "Hi!";
Intent in = new Intent(this,ActivityTwo.class);
in.putExtra("Key1", value1);
in.putExtra("Key2", value2);
startActivity(in);
[/sourcecode]

ActivityTwo.java

[sourcecode lang=”java”]
Bundle bundle = getIntent().getExtras();
String valueReceived1 = bundle .getString("Key1");
String valueReceived2 = bundle .getString("Key2");
[/sourcecode]

 

Method 2 : Using Bundle to pass and to extract data between activities in Android

ActivityOne.java

[sourcecode lang=”java”]

String value1 = "Hello!";
String value2 = "Hi!";
Intent in = new Intent(this,ActivityTwo.class);
Bundle bundle = new Bundle();
bundle.putString("Key1", value1);
bundle.putString("Key2", value2);
in.putExtras(bundle);
startActivity(in);
[/sourcecode]

ActivityTwo.java

[sourcecode lang=”java”]
Bundle bundle = getIntent().getExtras();
String valueReceived1 = bundle .getString("Key1");
String valueReceived2 = bundle .getString("Key2");
[/sourcecode]

 

Code for passing array between activities in Android :

ActivityOne.java

[sourcecode lang=”java”]
String[] array = new String[]{"Item1", "Item2", "item3", "Item4", "item5"};
Intent in = new Intent(this,ActivityTwo.class);
Bundle bundle = new Bundle();
bundle.putStringArray("MyArray", array);
in.putExtras(bundle);
startActivity(in);
[/sourcecode]

ActivityTwo.java

[sourcecode lang=”java”]
Bundle bundle = getIntent().getExtras();
String arrayReceived[] = bundle.getStringArray("MyArray");
[/sourcecode]

 

Code for passing ArrayList between activities in Android :

ActivityOne.java

[sourcecode lang=”java”]
ArrayList<String> array = new ArrayList<String>();
array.add("Hello");
array.add("Hi");
array.add("Bye");
Intent intent = new Intent(this, ActivityTwo.class);
intent.putExtra("array_list", array);
startActivity(intent);
[/sourcecode]

ActivityTwo.java

[sourcecode lang=”java”]
Bundle bundle = getIntent().getExtras();
ArrayList<String> array = (ArrayList<String>) bundle.getStringArrayList("array_list");
[/sourcecode]


Have fun with Intent.

How to publish Android app to Google Play Store?

Objectives :

  • How to publish Android app to Google Play Store?
  • How to publish Android app to Google Play Store using Eclipse?
  • How to create keystore in Android?
  • How to zip align an Android app?
  • How to export signed Android package?
  • How to export signed Android APK?
  • How to export signed Android app?
  • How to create signature for Android app?
  • How to compress Android app for publishing?
  • How to make an Android app ready for publishing?

This video will guide you to publish your own Android apps on Google Play through some simple steps and that too with few clicks. This small video will answer all the questions above.

The video was recorded during a Online Android Training and uploading unedited video here. The training was conducted from Doha, Qatar. If you need online training on Android or need any support, please feel free to write me at aatul@ancyber.com

Please feel free to share the video if you like it and do comment below. And subscribe to my YouTube channel for more video tutorials.

[youtube=https://www.youtube.com/watch?v=1PsByMlw_zE]

Android Training at Oracle

20141215_175238

 

Conducted 3 days Live and Online Android Training at Oracle Mumbai from Oracle Park, Pune dated 15th Dec. 2014 to 17th Dec. 2014. It was a great experience to conduct training for the giant like Oracle. It is always pleasure and fun working with Oracle people. After the completion of the training received great feedback from all the attendees, glad to see that people out there liked training methodology. I always love to share the knowledge and experiences with the people.

LightMeUp – Flashlight Application for Android

LightMeUp – Flashlight Application for Android

It is a small application which uses the Camera Flash to enlighten and which may also help you in searching something in dark. The best part is it works in a single click on  your Android phone with or without flash. If your phone does not have flash, it will set brightness of your phone to maximum, as soon as you close application it will set brightness back to original.

This application was developed as a part of Android Training we provide at AnCyber, Pune (India).


Get it on Google Play

Go, download and get enlightened.

Seminar on Android in Pune

[youtube=http://www.youtube.com/watch?v=3jhcCbj7xyE]

Conducted Seminat on Android at Pimpari Chinchwad Polytechnic, Pune on 10th Jan. 2014 between 2 pm to 4 pm.

It was great to share knowledge and experience with such a good and enthusiastic crowd.