Atul Palandurkar

AutoScroll TextView Demo

Objectives :
– How to use TextView in Android?
– How to scroll Text in Android?
– How to implement Marquee Text in Android?
– How to make text scrollable in Android?

Getting Started :
1. Create a New Android Application titled as “AutoscrollTextviewDemo” with blank activity.
2. Update the layout xml with code given below.

How to do it?
Here is the XML code for Auto Scroll TextView, update your layout xml file with code below.

[code language=”xml” 1=”highlight(14,15,16,17,18)”]
<LinearLayout xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AutoScroll TextView" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:scrollHorizontally="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit ="marquee_forever"
android:focusable="true"
android:focusableInTouchMode="true"
android:text="This is small example for auto scroll text view simply using XML, no need to code Java. Hope you like it! Try it on your own, it is very easy to perform" />

</LinearLayout>
[/code]

Download Source Code
Output :

Output in Potrait mode

Output in Potrait mode

Output in Landscape mode

Output in Landscape mode

This is small example for auto scroll text view simply using XML, no need to code Java. Hope you like it! Try it on your own, it is very easy to perform.

Click here to download source code.

Happy Birthday NetBeans

[youtube:http://www.youtube.com/watch?v=ZKhbiNJmH8E&feature=youtu.be]

Video is created by members of JUG Nagpur, NUG Nagpur and JDuchess Nagpur to wish NetBeans a Very Happy Birthday and to show their love towards NetBeans.

Feel free to share video to show your love towards NetBeans.

5 days Corporate Training on Android for MIM

[youtube:http://www.youtube.com/watch?v=Ul3y2Jtunmk&feature=youtu.be]

Conducted Corporate Android Training at MIM (Millennium Institute of Management), Aurangabad (India). This training was basically for faculties of MCA department of MIM. It was 40 hrs Android Training that means 8 hrs daily excluding breaks.

On the very first day of training conducted a introductory seminar on android for the students of MCA and MBA departments of MIM. And I am glad to know that they have developed an application too, its really nice.

I have delivered so many lectures till now to many corporates, individuals and students that I don’t even remember but it was great experience delivering training at MIM and I was feeling like a king because of the arrangements by the management for me and my team. I was allocated a room which was 600 years old and was built by the Masters of Mughal Emperor Aurangzeb and it is maintained so nicely that I never felt that the room was a part of a 600 years old hostel for students beside school of the same era where very own king of Mughal Emperor Aurangzeb had studied, classrooms are still maintained as it was. And the food was so awesome that for once I felt to get settled in Aurangabad only but then I reminded of my wife and family. I will never forget those moments.

Thanks a lot again for everything to the trainees and the management of MIM. I would love to visit again and again to MIM, feel free to give a call anytime and I will be there for you people.

Taking text input in Android via EditText

Objectives :

  • How to take input in Android?
  • How to take text input in Android?
  • How to use EditText in Android?
  • How to take multiline input in Android?

If you wish to take text input in Android, you can use <EditText> to take the text input in Android.

Here is the small example showing different uses of EditText. EditText can be also used to take multiline input as that of textarea.

[sourcecode language=”xml”]

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="First Name" />

<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:id="@+id/EditTextFirstName"
android:hint="First Name" />

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Cell No" />

<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:hint="Cell No." />

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Email ID" />

<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:hint="Email Name" />

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Message" />

<EditText
android:id="@+id/editText1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:lines="5" />

</LinearLayout>

[/sourcecode]

Multiline Input in Android

If you need, you can use the same <EditText> to take multiline input as per the code snippet given below :

[sourcecode language=”xml”]
<EditText
android:id="@+id/editText1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:lines="5" />
[/sourcecode]

Here, android:inputType=”textMultiLine” will convert the single line text input into multi line input and android:lines=”5″ will give 5 (five) visible lines input.

Seminar on Android

[youtube:http://www.youtube.com/watch?v=aecJw6iPlno&feature=youtu.be]

Conducted 2 hour Seminar on Android at Shree Datta Meghe Polytechnic, Nagpur on 6th Aug. 2013 at 12 noon.

It was again great experience during the interaction with the students of SDMP, shared experiences and had a day long discussion with the students. Awesome experience.

Writing HelloWorld in Android

Objective :

  • How to write HelloWorld Application in Android?
  • How to write HelloWorld App in Android?
  • How to write HelloWorld in Android?

To create HelloWorldApp follow the steps below :

  • Go to File Menu > Go to New > Click on Android Application Project.

  • In New Android Application Window, enter Application Name as “HelloWorldApp”. Do not change anything else and click Next.

  • While you are in Configure Project Window, uncheck the Create custom launcher icon. Do not change anything else. Click Next.

  • In Create Activity window, click Next.

  • In Blank Activity Window, change the Activity Name to “HelloWorldApp”. Do not change anything else. Click Finish. And your HelloWorldApp Android application will be created.

Here is snapshot of HelloWorldApp project structure :

HelloWorldApp Project Structure in Android

XML Code for UI

File : activity_hello_world_app.xml

[sourcecode language=”xml”]

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />

</RelativeLayout>
[/sourcecode]

XML code which manages all the string items or labels.

File : strings.xml

[sourcecode language=”xml”]
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">HelloWorldApp</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
</resources>

[/sourcecode]

Java Code

File : HelloWorldApp.java

[sourcecode language=”java”]
package com.example.helloworldapp;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

public class HelloWorldApp extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_hello_world_app);
}

}
[/sourcecode]

After writing your code, to run this snippet you need an AVD (Android Virtual Device) or Emulator. Here is tutorial link which will help you to create AVD so as to run your Android application.

How to create AVD (Android Virtual Device) or Emulator?

Objectives :

  • How to create AVD?
  • How to create Android Virtual Device?
  • How to create Emulator for Android?
  • What is AVD (Android Virtual Device)?

AVD (Android Virtual Device) / Emulator

AVD (Android Virtual Device) is an Emulator which helps in running Android applications onto your computer/laptop and you don’t need physical device every time you write/change code. Using an AVD you can run and test nearly every feature of your application right from simple text, GPS, Camera, Database, etc.

Creating AVD :

  • To create go to Window menu > Click on “Android Virtual Device Manager” or “AVD Manager” option.

  • In Android Virtual Device Manager or AVD Manager window, click New button.

  • In Create new Android Virtual Device (AVD) window, set credentials for new AVD you wish to create, press OK.

  • Select AVD you have created from the list and click Start > click Launch.

  • Here is an AVD you have created, now you are ready to run your Android application.

You can have a look at this tutorial so that you can Quickstart Android Application Development. So start writing your Android applications now.

APN Setting for USB Modem or Netsetter

Objectives :

  • What is APN Setting for Airtel USB Modem?
  • What is APN Setting for Idea USB Modem?
  • What is APN Setting for BSNL USB Modem?
  • What is APN Setting for Vodafone USB Modem?
  • What is APN Setting for Aircel USB Modem?
  • What is APN Setting for Tata Docomo USB Modem?
  • What is APN Setting for Reliance USB Modem?
  • What is APN Setting for Uninor USB Modem?

 

Airtel APN Setting :

Profile Name: Airtel
APN : airtelgprs.com
Access Number: *99#

Idea APN Setting :

Profile Name: Idea
APN : Internet
Access Number: *99#

BSNL APN Setting :

Profile Name: BSNL
APN : bsnlnet
Access Number: *99#

Vodafone APN Setting :

Profile Name: Vodafone
APN : www
Access Number: *99#

AirCel APN Setting :

Profile Name: Aircel
APN : aircelgprs
Access Number: *99***1#

Tata Docomo APN Setting :

Profile Name: Docomo
APN : tata.docomo.internet
Access Number: *99#

Reliance APN Setting :

Profile Name: Reliance
APN : rcomwap
Access Number: *99#

Uninor APN Setting :

Profile Name: Uninor
APN : Uninor
Access Number: *99#

Enjoy internet surfing now.

HTML5 VS. HTML4

Objectives :

  • What are the differences between HTML4 & HTML5?
  • What is new in HTML5?
  • What is deprecated from HTML5?

Here are the key differences between HTML4 & HTML5:

HTML4

HTML5

DOCTYPE is much longer as HTML4 is based on SGML-based.

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01//EN”

DOCTYPE is required to enable standards mode for HTML documents.<!DOCTYPE html>

Audio and Video are not part of HTML4 specification.

Audio and Videos are integral part of HTML5 specifications e.g. <audio> and<video> tags.

Vector Graphics is possible with the help of technologies such as VML, Silverlight, Flash etc.

Vector graphics is integral part of HTML5 e.g. SVG and canvas.

It is almost impossible to get true GeoLocation of user browsing any website especially if it comes to mobile devices.

JS GeoLocation API in HTML5 helps identify location of user browsing any website (provided user allows it)

Browser cache can be used as temporary storage.

Application Cache, Web SQL database and Web storage is available as client side storage. Accessible using JavaScript interface in HTML5 compliant browsers.

Web Sockets are not available. Generally used mechanisms are long polling and streaming.

Full duplex communication channels can be established with Server using Web Sockets. Accessible using JavaScript interface in HTML5 compliant browsers.

Does not allow JavaScript to run in browser. JS runs in same thread as browser interface.

Allows JavaScript to run in background. This is possible due to JS Web worker API in HTML5.

Works with all old browsers

Most of modern browser have started supporting HTML5 specification e.g. Firefox, Mozilla, Opera, Chrome, Safari etc.

Enjoy coding now.

HTML5 Infographic

Objectives :

  • What is HTML5?
  • What is new in HTML5?
  • What is not in HTML5?
  • What is removed in HTML5?
  • Which tags are included in HTML5?
  • Which tags are obsolete in HTML5?
  • Why HTML5?
HTML5 Features : Infographic

HTML5 Features : Infographic

  • There are many new features in HTML5 which are incorporated in HTML5 in the form of new tags such as <canvas>, <header>, <footer>, <section>, <article>, <menu>, <figure>, <audio> and <video> by WHATWG.
  • While there are many new features and tags are added to HTML5 but some old tags are removed too like <b>, <font>, <frame>, <center> and <big>.
  • New features and syntax are much simplified than HTML4 such as doctype declaration is one of them and now you can simply write <!doctype html>
  • HTML5 syntax are compatible with HTML4 and XHTML but not with SGML.
  • Apart from all of these new feature HTML5, it is still under in progress and you should keep track of latest happenings in HTML5.