Immanuel

Sunday, November 11, 2012

Installisation issues with Appcelerator Titanium - Ubuntu 12.04

Appcelerator titanium is used to develop cross-platform mobile application on Android, iOs, Mobile web using the Javascript SDK.

Titanium converts the javascript calls to the native application call on the device.
For example if you write the code for label in the javascript you can able to compile the same code for Android, iOS, mobile web . In the Android the system call will be made as the dialog and so on and so forth,

To get started you need to have the appcelerator account, It is free of cost just visit the following link to create it.

https://my.appcelerator.com/auth/signuphttps://my.appcelerator.com/auth/signup

Once you have created the account just login to the account in the link below

https://my.appcelerator.com/auth/loginhttps://my.appcelerator.com/auth/login

Appcelerator Titanium is available for  Windows, Linux, Mac. I have installed in Ubuntu (Linux- Debian Flavor).

Issue I

The error that i got is a dialog box which has "Launching Aptana Portal has encountered a problem"

In the details i got these "An internal error has occurred. No more handlesNative code library failed to load. (java.lang.UnsatisfiedLinkError: /home/users/ajaikumark/Downloads/Titanium_Studio (2)/plugins/com.aptana.swt.webkitbrowser.linux.x86_1.0.0.1334860664/os/linux/x86/libcefjni.so: libjpeg.so.62: cannot open shared object file: No such file or directory)"

So here is the solution you need to install this following package.

Follow the following commands

Get the root access

sudo su
>Enter your root password

sudo apt-get install libjpeg62

If you have any issue update the repository list and try again

sudo apt-get update

sudo apt-get install libjpeg62

Issue II

You need sun Java to open the Titanium.

Installation of  sun-java6-jdk, sun-java6-jre, sun-java6-plugin on ubuntu 12.04 LTS 

  This repository is available for: Natty  Oneiric  Precise:

 To add ppa:

sudo apt-add-repository ppa:flexiondotorg/java

sudo apt-get update

sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-jdk

 If you have any issues try the following commands

sudo apt-get install python-software-properties

Now try the above commands. 

Hope this post helped you .

Happy Hacking...

Friday, November 9, 2012

Getting Started with Selenium IDE - Installation

Selenium is the IDE to record,test and debug the web Scripts. It is the complete IDE which comes as the plugin to the browsers. It is easy to learn and implement for automating the testing.
To get started you need to install selenium into your web browser. It is very simple to install just visit the link below

http://seleniumhq.org/download/

Download the latest version under the Selenium IDE Block. The latest version is 1.9.0

I am using Ubuntu 12.04 32 bit Operating System , Actually operating system is not the concern .

I am using the default browser Firefox. In Firefox (Browser)  allow the  add on to install. Once the download has been completed you must need to restart the browser to complete the installation. Once you restart the browser you are ready to go.

In Firefox you can see this add on at

Tools - > Selenium IDE

or

Ctrl + Shift + S

Now the Selenium IDE will open as shown below


This is the good tool to make test automation. I will also post how to make automation in selenium in my future posts.

Happy Hacking ...

Thursday, November 8, 2012

How to take screenshot from Android Mobile/Tablet

Taking screen shot of the android mobile/tablet can be done in very few steps.

This is the steps that i follow to take screen shot of the mobile devices.

I am using ubuntu 12.04 connected with the iberry Tablet that is running android Ice Cream Sand wich.

First you need to connect the device using USB Data cable and turn on the USB Debugging mode in the device.

Launcher -> Settings -> Developer Options -> USB debugging (Check it)

Now open the terminal in the computer

Ctrl + Alt + T

Go to the location of the android sdk folder

In my case i have my android sdk folder at

/home/user7/Documents/J2EE


Once you are inside the android sdk folder you can see the folder named tools
now get into the folder

cd tools

Now run the ddms file

./ddms


Now select the device and click on

Device -> Screen Capture...

or

Ctrl + S

You will get the device screen on your desk

Click Save to take the shot

Refresh to get the updated screen

Click Rotate to rotate the screen image

Once you are done click on Done

Happy Hacking...


Thursday, November 1, 2012

DroidDraw Installisation -Run Jar File in Ubuntu

Droid draw is a open source tool to design GUI builder for android application you can use this in windows as well as Ubuntu and Mac OSX.

The code is available here.
  
 To install in linux you after getting a jar file just follow the instruction below

open the downloaded path and check for the jar file

ls -a

This will list all the file in the directory , just check for "droiddraw.jar"

Switch to root user
sudo su

Enter your password 

Now type the following command to run the jar file

java -jar droiddraw.jar
Happy Hacking...


Tuesday, October 30, 2012

Android Web View - Progress Dialog, Full Screen


Android provides WebView to load the Web pages inside the application itself, we can customize this webview according to our needs.

Traditionally we will use handlers to handle the events but in android we can use the pre-defined methods to handle the events,

In this post i have explained how to load progress dialog while page is being loaded and hoe to keep the web view in the full screen mode .

1.Full Screen:
                      To use the web view in the full screen just use the simple code given below.

this.requestWindowFeature(Window.FEATURE_NO_TITLE);

The only condition using this is , you should use this code before setContentView as given in the project file attached with this blog post.

2.Using Progress Dialog:
                         As i mention earlier you can use progress dialog until your page gets loads. 

Once you complete the inflation process use the following code

               web.setWebViewClient(new WebViewClient() {

               public void onPageStarted(WebView view, String url, Bitmap favicon) {
                dialog = ProgressDialog.show(ProgressDemoActivity.this, null,
                        "Please Wait...Page is Loading...");
                dialog.setCancelable(true);
                super.onPageStarted(view, url, favicon);
            }


                public void onPageFinished(WebView view, String url) {
                dialog.dismiss();
                super.onPageFinished(view, url);
            }

The first method will be triggered once the page is start loading, as shown below


The Second method will be triggered once the page is completely loaded,once it is triggered the dialog will get disappeared, as shown below


You will get this dialog every time  you navigate inside the web view, as shown b 

 For more detail you can use this eclipse project here

Get the code in  GitHub

Happy hacking...


Sunday, October 21, 2012

Getting Started with WordPress (Installisation and Configuration)

Designing a web site made easy with the CMS ( Content Management System). One of the very famous CMS is WordPress.
Here i have explained the installation steps for WordPress.

Requirements:
1.WordPress
2.Web Server
3.Data Base Server

Where can i get all these requirements?  

All the above requirements are available in the Internet.

1.WordPress
                         WordPress can be downloaded from the official site - here 
You will get the zipped file just extract the file. we will get started once we get other two requirements.

 2.Web Server
                          Web Server is the one which is use to run the web pages and serves to the web clients.
The very famous web server is Apache. We will see the installation and configuration of web server below.

3.Data Base Server
                            WordPress needs Database, so we need a separate server.
                             I use My sql as a database server.

 Is Internet connection is mandatory ?
  1. Yes, you need Internet to download the required stuffs.
  2. And you may not need Internet connection for designing the web site if you follow OFF LINE Procedure written in this blog.
  3. Also you need Internet to host your web site after designing.
Does Initializations of two server will take much time?

            Actually we are not going to setup servers for a very big application like facebook.com , twitter.com.

This made easy with XAMPP
XAMPP
X- Cross Platform of
A- Apache
M- MYSQL
P-  PHP
P-Python.

So we got two servers in one package. Its absolutely Free of cost.You can download and install xampp for both Windows and Linux here.

Note: Kindly disable all the firewalls, anti virus(Windows), previously installed web servers, Database servers.
 Because Apache will use port 8080 and MYSQL will use port 3306.

Once you installed the XAMPP. Open its directory and open the XAMPP control panel by opening the file "Xampp-control".

Here you can see "Apache", "Mysql"  click on start on both the servers, you will find those are running as shown below


Once both the servers are started you can proceed the WordPress Installation.Now click on the Admin button of the Apche . It will open the xampp splash screen in the web browser.

Select the Language.

It will open the Xampp Home Page (http://localhost/xampp/index.php)

In this URL localhost is the directory that i have installed xampp. In the above figure you can see the current directory as "D:\program files\xampp". 8080 is the default port used by the Apache server. 

We can now install the WordPress, Extract the WordPress folder from the zipped file that you downloaded.

Copy the folder and paste inside the htdocs folder
xampp installed directory -> apache -> htdocs.
In my case
D:\program files\xampp\apache\htdocs
Paste the folder inside this folder because apache web server's configuration folder is htdocs.

I have pasted the folder named "wordpress" inside "htdocs"

Now open the browser and open the URL

                                http://localhost/wordpress
Once you open it you will get a error page that you did not configured wp-config.php as shown below



So Click the "Create Configuration File" button and the new page open as shown below



 Now Lets Go!, The New Page Opens a form to setup the WordPress configuration as shown below


Before Getting Started, you need database for the WordPress so open the Xampp- control Panel and click on the My sql admin. or open http://localhost/phpmyadmin as shown below

Enter the new database name in the textbox and click on create.

I have entered as wordpress.

Close this page, In the WordPress installation Fill the
DB Name As "wordpress"
UserName as "root"             Root User of MySql
Password as ""                      Clear that field because MySql will not have any password by default
Database Host as "localhost"    Since we are running server in loclhost

Click Submit it will install necessary tables in the database and now the new page will open asking site details as shown below

Enter the site title
Enter the Preferred User name             
Note:This will be needed for logging in to the site to add, edit, delete content.
Fill the password
Note: Be careful it is also needed to log into the site
Enter e mail id
Click Submit.

It will open the another page click on Login.

The Login Page will appear as shown below

Enter the user name and password that you have given in the previous form.
Once you are authentic to the system the page redirect to the Dashboard of your site as shown below

This is the place where you can edit your site.

To Visit your site
                                                http://localhost/folder-name
i have given the folder name as wordpress so
                                                http://localhost/wordpress
To Open the admin dashboard just add /wp-admin to the URL
http://localhost/wordpress/wp-admin

You Have successfully installed WordPress.
Happy Hacking



Thursday, October 18, 2012

Handling Orientation changes - Android

There is a difficulty for the UI/UX designers to design the User Interface for the android application. The major problem i see is the orientation change, Usually smart phones have two orientations they are portrait, Landscape. If you design the UI in the portrait orientation it will be in the vertical manner (i.e) the height is larger than the width . When you see in the Landscape orientation it is in the horizontal manner (i.e) the width is larger than the height.

To over come this problem i have used two different layouts in the same name.

E.g

File:res/layout/activity-main.xml

Design for portrait orientation in this file




This file will be loaded for the portrait orientation.

create a new folder named layout-land under the res folder. Now create the new xml file in the same name, in this example it is activity-main.xml

File:res/layout-land/activity-main.xml

Design for landscape orientation in this file



This file will be loaded for the Landscape orientation.

These layouts will be automatically loaded by the android system when you change the orientation. The data you typed in the fields will be available even after changing the orientation because it it will not destroy the activity.

Use Ctrl+F12 to switch the orientation of the emulator in Linux (Ubuntu).

Happy Hacking...

Wednesday, October 17, 2012

HTTP Session in JSP Servlet - Example

Hey Every one , As we know HTTP is a state less protocol so it is necessary to carry out session in the web application. If you were wondering  how your browser remember your session though the http is stateless, it is very simple.

I have attached the war file with source code . Import the war file to your eclipse.

Also I have attached the file "DB.sql" u can use it as the query log for setting up Database.

I have used the my sql as my back end database.

LINKS:

GitHub

War File

SQL FILE / QUERY LOG 

Inserted of this SQL file you can also use the following sql queries

CREATE DATABASE SESSION;
USE SESSION
CREATE TABLE LOGIN (USERNAME VARCHAR (30), PASSWORD VARCHAR (30));
INSERT INTO LOGIN VALUES("arun","immanuel");


Happy Hacking...



Android Emulator KeyBord Commands

Hey droid developers make use of the shortcut keys of the android emulator .

I have tested with the ICS Emulator shown below




Emulated Device Key Keyboard Key
Home HOME
Menu (left softkey) F2 or Page-up button
Star (right softkey) Shift-F2 or Page Down
Back ESC
Call/dial button F3
Hangup/end call button F4
Search F5
Power button F7
Audio volume up button KEYPAD_PLUS, Ctrl-F5
Audio volume down button KEYPAD_MINUS, Ctrl-F6
Camera button Ctrl-KEYPAD_5, Ctrl-F3
Switch to previous layout orientation (for example, portrait, landscape) KEYPAD_7, Ctrl-F11
Switch to next layout orientation (for example, portrait, landscape) KEYPAD_9, Ctrl-F12
Toggle cell networking on/off F8
Toggle code profiling F9 (only with -trace startup option)
Toggle fullscreen mode Alt-Enter
Toggle trackball mode F6
Enter trackball mode temporarily (while key is pressed) Delete
DPad left/up/right/down KEYPAD_4/8/6/2
DPad center click KEYPAD_5
Onion alpha increase/decrease KEYPAD_MULTIPLY(*) / KEYPAD_DIVIDE(/)

Format External Devices - Linux

It is very common formatting a External drive. People think that linux is not supported in this feature. Actually Ubuntu does have this feature in the GUI but it is possible in the Command line.

Get the root access in the command line

user6@samgha-desktop6:~$ sudo su
[sudo] password for user6:
root@samgha-desktop6:/home/user6#


Unmount the device

umount /dev/sd                                                  -  Make sure the device you have selected the proper device.

Now enter the following command

root@samgha-desktop6:/home/user6# mkdosfs -n "ANDROID" -I /dev/sdb
mkdosfs 3.0.12 (29 Oct 2011)


Here "ANDROID" is my external device.

Happy Hacking...

Tuesday, October 16, 2012

Sclae Web Page according to the Device Size - Android 4.0 WebView

Web pages can be opened from the application using the web view. The actual problem come when you open the web pages in different screen. It is not a good idea to create the page or a application for every devices. So what to do ...?

It is possible to scale the web pages in web view it self now lets see how .

Create the web view layout in res/layout.home.xml


android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/webview">


Inflate this in a java file

WebView webview;
setContentView(R.layout.home);
webview = (WebView) findViewById(R.id.webview);
webview.loadUrl("file:///android_asset/IT/index.html");
webview.getSettings().setJavaScriptEnabled(true);

This will open the web page that is not properly fit into the screen so the solution is very simple just add three more lines.

webview.getSettings().setLoadWithOverviewMode(true);
webview.getSettings().setUseWideViewPort(true);
webview.getSettings().setDomStorageEnabled(true);

Happy Hacking..

Tuesday, October 2, 2012

Tabs at the Bottom of the Activity

Tab Layout in android always displays the tabs at the top, but this occupies lots of space at the top of the application.

This could be overcome by very few steps

  1. In your vertical LinearLayout, put the FrameLayout above the TabWidget
  2. Set layout_height to wrap_content on both FrameLayout and TabWidget
  3. Set FrameLayout's android:layout_weight="1"
  4. Set TabWidget's android:layout_weight="0" (0 is default, but for emphasis, readability, etc)
  5. Set TabWidget's android:layout_marginBottom="-4dp" (to remove the bottom divider)
Full Code

Monday, July 16, 2012

Installing Android in Windows

The Android Application can be developed in the pc that running on windows , Follow the steps given below,
You need following things before get started
1.JRE 6 or Above
2. Eclipse Indigo
3.ADT (Android Development Toolkit)
4.Android-SDK (Software Development Kit)

Note: If you download android sdk from the developers.android.com they will not provide platforms . here you can see in side a platform folder you will have one folder named "Android-8". It means you can develop application for the android 2.2 . The 8 means the API level of the Android.
Now lets get Started
1. Install Java
2. Extract the eclipse-java-indigo-SR2-win32  and Double click on the file ("eclipse.exe")
3.When you open the eclipse it will ask to select the work space, The work space is the place where the projects we do will be saved
4.Now we Install ADT in eclipse go to Help->Install New Software...,Click on ADD,Now type Any Name as AVD, and click on Archive,Now select the ADT-18.0.0.zip that you have downloaded.
5.After selecting the zip file and click ok , the Developer tool will appear on the screen check them all click Next,.Then accept the licence and wait for installation .If it shows any warning just click ok,Then it will ask for restart eclipse , Click it to restart,
6.Its time to install SDK
7.Extract the android-sdk.zip.
8.When eclipse opens select the work space and then wait the dialog will appear telling you to install sdk just cancel it.
9.Go to Windows->Preference,select Android tab
10.Now click on Browse and select the android-sdk folder, Click Apply, then android 2.2 will appear now select that and click ok.
11. Now the environment is ready to develop android application ,but we need a emulator to test our android projects,so we need AVD
12.Go to Windows->AVD Manager Click on New,Type the Name of the AVD ,Select the Target as Android 2.2 - API Level 8, now click OK.
13. Now Avd is created . Select the avd and click on start, a new dialog will appear now click launch.
14.The Avd will start now
Note:Do not disturb the Avd when its booting up since it may lead to Not responding mode
Starting Screen of Avd


Loading Avd

Avd Lock Screen
To unlock hold the left button of the mouse and check on the lock button and drag towards the right side

Avd Home Screen


 So finally we have successfully installed Android.



Hello World !!! Android Users Group

Hello World !!! I am Arun Jaya Immanuel V , I have learned android in my summer vacation, i am a FOSS promoter in my college days i use to spread the open source technologies in my college. After learning this android i am very happy that i can share this technology to the people across the world who want to learn android. So i have created the FB page (Android User Group) . From now on i will be blogging the things from the scratch to this blog and also share this in the FB page . People who are learning android can ask query's in the FB page or by E mail(immanuel2305@gmail.com,dhayanithimca@gmail.com) we will answer your queries with example programs.
"Grow your Skills , Share Knowledge"



Thursday, May 3, 2012

Open Developer Network | Summer 2012

The Open Developer Network in Chennai is opening the new course steam for the young developers . The students can use this chance to lean various stream like Red Hat ,Android,Java,Web Service , JSP, and more.

The world of technology is like a sea there are lots to learn " Lets start here, we will make the mile stone in the technology".
I am the campus representative for the Arunai Engineering College .Guys who are intrested in joining this course please contact me +91-9994582193,immanuel2305@gmail.com,www.facebook.com/immanuel2305

Friday, March 30, 2012

Remove sql server 2005 express tools - Installing SQL Server 2008

This is a problem in installing SQL SERVER 2008 .You need to uninstall SQLServer 2005 express tools but its not possible in control panel just follow the simple way

1.Goto Run -> regedit 
2.Expand to the following path HKEY_LOCAL_MACHINE > Software > Microsoft > Microsoft SQL Server > 90


3.Now delete the Registry key 90
Twitter Bird Gadget