Thursday 23 June 2016

Working with Open Fire Chat Server Step By Step

Welcome to the Simple Android Chat App Tutorial with XMPP Integration tutorial which will take you on a step by step guide on how to create your very own chat app with back end integration. We will use XMPP server Open Fire as a chat server.
Here is how to build a simple group chat app using an open source XMPP/Jabber client for Android 4.0+ smart phones named Conversations  . I won’t say this is the only way to build a chat app, but it is the quick & easiest way to build one. 
Conversations works with every XMPP server out there. However XMPP is an extensible protocol. These extensions are standardized as well in so called XEP's. Conversations supports a couple of these to make the overall user experience better.
Following is the step by step integration of all component of our chat application:
Installing OpenFire Server 
Step 1:  Download Open Fire XMPP Server from there official website .  You must go for the latest build for server. Here we will user Openfire 4.0.1.
Step 2: Run the Openfire installer. The application will be installed to C:\Program Files\Openfire by default.
Step 3:  Follow the instruction Once the installation is finished,
Openfire will start automatically with a pop-up showing options Stop, Launch Admin, Quit.





Click on Launch Admin, You will be redirected to this page in default browser.Select the server side language. Click on

Configuration of  the Server
Next is server setting ,put your domain name as following you may use localhost (your static IP) or it may be your system username. Note that this will be used in jabber id.Do not change the rest settings. Click on continue
Third step in configuration is Database setting: Here we have 2 ways to setup the database:
  • Embedded Database
  • Standard Database Connection
Embedded Database:  Embedded database is the easiest way to configure and setup as it does not require any external database. However, it does not give the same level of performance as given by an external database.If you choose to use Embedded Database and click continue then it will take you to Profile settings.

Standard Database: Standard Database connection requires an external database up and running.By default Standard Database is selected, click on continue to configure to external database.
here we will use embedded database .Click "Continue " now next is profile setting Keep this default for now.  It is important step of Admin account setting. Fill the details as following
This is the final step of our web base configuration. Make sure you enter a valid email address for your admin. The default password for admin is ‘admin’. Enter your new password and confirm password and continue to proceed to see the Setup Complete message.
You can login by using the Admin account info you added during server configuration . Here is an important thing to note you just need to put "admin" as usernameand password as "admin".
 Here we have completed one out of three steps. Now its time to go for step 2 which is installing windows client to test our running XMPP server. 
An XMPP client is any software or application that enables you to connect to an XMPP for instant messaging with other people over the Internet. There are many free clients you can use to do this, for many different devices and operating systems. You can find the list of clients here
In this tutorial we will use windows xmpp client Gajim to test our OpenFire server configurations.Install this by running setup.exe . After installation you will able to launch client
First thing is to add your xmpp user we made on our server. Go to File->Edit- > Account    following screen will occur
Press add button and select I have already a registered account


Press ‘Forward’ and a dialog comes click ‘Finish button’ on that you will come on the main screen
Now right click on user make status available---------àright click ------à Start Chat

Here we will input the name of another user for example mukesh@cyber-pc.
Press OK

Android Client:   Here we can say everything is working perfectly. Now we are going to implement a android XMPP client open source project ‘Conversation’ . You can download it from its repository on GitHub  . You can clone or download it on your pc.

Import  this  Gradle based project into Android Studio and build it. Once you built it you need to change following things only in android studio Conversation project structure .

Go to eu.siacs.conversations.Config.java and provide your local ip in line no 41 like public static final String MAGIC_CREATE_DOMAIN = "10.0.16.132";  And its done. Run this project in devices running with same internet lan address  So Here we get the following output
References: GitHubGajim,conversations

Tuesday 22 March 2016

List Of usefull Android Sample To Do Task

http://kalisandroid.blogspot.in/2015/06/horizontal-listview-inside-listview-rows.html

Easy Facebook Interaction in android App

http://kalisandroid.blogspot.in/2014/11/facebook-integrations.html

Listing Out Files from SDCard in android



http://javatechig.com/android/listing-all-sdcard-filenames-with-extensions-in-android

http://kalisandroid.blogspot.in/2015/01/load-pdf-files.html

Saturday 8 August 2015

Welcome to a place of android tips

Hello visitor, It a little hand of help to those are learning the android programming.Every beginner find some basic problem which cant seems to be a problem later.But that time he finds this little problem the big hurdle  of his path. This blog is effort to support beginners in android programming. If you have got some good tricks of genral problem ,you can be a editor of my blog post.

Thanks