Welcome, Guest: Join Nairaland / LOGIN! / Trending / Recent / New
Stats: 2,657,333 members, 6,236,755 topics. Date: Sunday, 11 April 2021 at 12:00 AM

How To Develop Instant Android Chating App(social Network) - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / How To Develop Instant Android Chating App(social Network) (2697 Views)

Tytit, A Social Network Created By An 18 Years Old Nairalander / Check Out Social Network I Built From Scratch With Php - Gisthive / The Latest Nigeria Social Network Site 2017 (2) (3) (4)

(1) (2) (Reply) (Go Down)

How To Develop Instant Android Chating App(social Network) by adenuga558(m): 3:17pm On May 07, 2017
Am bring an idea up on how to develop android chat app using php, mysql, Json as backend, so let start with the app splash screen, u can also come up with or idea and code here.
Re: How To Develop Instant Android Chating App(social Network) by adenuga558(m): 3:23pm On May 07, 2017
*****Splash Screen Implementation******
Re: How To Develop Instant Android Chating App(social Network) by adenuga558(m): 3:34pm On May 07, 2017
In this tutorial I’ll be covering implementation of splash screen. One is showing splash screen using a timer which takes some time to fetch required information. Both the tutorial are same except the splash screen activity. In order to implement splash screen we are going to create a separate activity for splash and once it closes we launch our main activity.bSo let’s get started by creating a new project
1. Android Splash Screen Using Timer
1. Create a new project in Eclipse or Android studio by navigating to File ⇒ New Android ⇒ Application Project and fill required details. (I kept my main activity name as LoginActivity.java)
2. For Splash Screen we are creating a separate activity. Create a new class in your package and name it as SplashScreen.java
3. Open your your AndroidManifest.xml file and make your splash screen activity as Launcher activity.

AndroidManifest.xml

<?xml version="1.0"encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.nairaland.Chat" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17"/> <application android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<!-- Splash screen -->
<activity android:name="com.nairaland.Chat.Activity.SplashScreen"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Black.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"/><category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Login activity -->
<activity android:name="com.nairaland.Chat.Activity.LoginActivity"
android:label="@string/app_name">
</activity>
</application>
</manifest>

4. Create a layout file for splash screen under res ⇒ layout folder. I named the layout file as activity_splash.xml. This layout normally contains your app logo or company logo.

activity_splash.xml

<?xml version="1.0"encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background">
<ImageView
android:id="@+id/imgLogo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/chat_logo"/>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:textSize="12dp"
android:textColor="#454545"
android:gravity="center_horizontal"
android:layout_alignParentBottom="true"
android:text="www.nairaland.com"/>
</RelativeLayout>

Note: You must have a image name background.PNG and chat_logo.PNG place in your drawable or mipmap folder
5. Add the following code in SplashScreen.java activity. In this following code a handler is used to wait for specific time and once the timer is out we launched login activity.

SplashScreen.java

package com.nairaland.Chat.Activity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

public class SplashScreen extends Activity {// Splash screen timer
private static int SPLASH_TIME_OUT =3000;
@Override protected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
newHandler().postDelayed(newRunnable() {/** Showing splash screen with a timer. This will be useful when you* want to show case your app logo / company*/
@Override public void run() {// This method will be executed once the timer is over// Start your app main activity
Intent i = newIntent(SplashScreen.this, LoginActivity.class);
startActivity(i);// close this activity
finish();
}
},
SPLASH_TIME_OUT);
}
}
Reference http://www.androidhive.info/2013/07/how-to-implement-android-splash-screen-2/
Edited by adenuga558/cyberpride.

1 Like

Re: How To Develop Instant Android Chating App(social Network) by adenuga558(m): 3:49pm On May 07, 2017
*****Login Implementation******
Re: How To Develop Instant Android Chating App(social Network) by yorex2011: 4:35pm On May 07, 2017
Nice tutorial
Re: How To Develop Instant Android Chating App(social Network) by Nobody: 7:46pm On May 07, 2017
*Spreads mat*
Re: How To Develop Instant Android Chating App(social Network) by adenuga558(m): 8:55pm On May 07, 2017
dhtml18 u dey here OK am posting login very soon
Re: How To Develop Instant Android Chating App(social Network) by donTee01(m): 3:41pm On May 12, 2017
How do you intend to implement real time messaging?
Re: How To Develop Instant Android Chating App(social Network) by adenuga558(m): 4:10pm On May 12, 2017
donTee01:
How do you intend to implement real time messaging?
still think about that also or do u know how to do DAT without d use of firebase
Re: How To Develop Instant Android Chating App(social Network) by donTee01(m): 4:22pm On May 12, 2017
adenuga558:
still think about that also or do u know how to do DAT without d use of firebase
Have u looked into XMPP?
Re: How To Develop Instant Android Chating App(social Network) by Nobody: 5:08pm On May 12, 2017
am watching
Re: How To Develop Instant Android Chating App(social Network) by adenuga558(m): 5:15pm On May 12, 2017
donTee01:

Have u looked into XMPP?
yea i don't want that ave done d login banned register user using php mysql and Json as api
I also want to use php mysql and Json for private chat I can also use php mysql and Json for group chat and follow member
Re: How To Develop Instant Android Chating App(social Network) by donTee01(m): 5:22pm On May 12, 2017
adenuga558:

yea i don't want that ave done d login banned register user using php mysql and Json as api
I also want to use php mysql and Json for private chat I can also use php mysql and Json for group chat and follow member

I mean EXtensible Messaging and Presence Potocol(XMPP) not XAMP
Re: How To Develop Instant Android Chating App(social Network) by donTee01(m): 5:23pm On May 12, 2017
dhtml18:
am watching
Pls, have you worked with xmpp or do u have any idea on its implementation?
Re: How To Develop Instant Android Chating App(social Network) by adenuga558(m): 5:28pm On May 12, 2017
donTee01:


I mean EXtensible Messaging and Presence Potocol(XMPP) not XAMP
am not talking about xamp am talking about d app backend
Re: How To Develop Instant Android Chating App(social Network) by Nobody: 6:34pm On May 12, 2017
You guys should please not distract this thread, I am just an observer on this thread
Re: How To Develop Instant Android Chating App(social Network) by Momentjs: 3:41pm On May 14, 2017
XMPP is more advanced and require higher level of expertise to implement. If you want to learn about it implementation you can check this repo

https://github.com/siacs/Conversations

It's a complete instant messaging App implemented with XMPP protocol.
Re: How To Develop Instant Android Chating App(social Network) by Nobody: 4:56pm On May 14, 2017
^^I agree with you, but however, there is no good reason to disrupt this thread. There are many approaches to a solution.
Re: How To Develop Instant Android Chating App(social Network) by jidez007: 5:52pm On May 14, 2017
Firebase is very easy to get started with. @op carry on.
Re: How To Develop Instant Android Chating App(social Network) by Nobody: 6:59pm On May 14, 2017
^^^and firebase is actually easier to setup compared to the xmpp things. As a matter of fact, GCM too is easier to setup.
Re: How To Develop Instant Android Chating App(social Network) by Momentjs: 7:18am On May 15, 2017
Firebase, GCM and Co all uses XMPP server.
I am not disrupting this thread.
Re: How To Develop Instant Android Chating App(social Network) by adenuga558(m): 9:06am On May 15, 2017
I was also told whatsapp use xmpp server
Re: How To Develop Instant Android Chating App(social Network) by Nobody: 9:33am On May 15, 2017
Okay, adenuga please continue your tutorial (and let us skip anything extraneous for now, it is distracting)

1 Like

Re: How To Develop Instant Android Chating App(social Network) by adenuga558(m): 11:09pm On May 30, 2017
sorry 4 d late comment I will continue 2morrow
Re: How To Develop Instant Android Chating App(social Network) by SilverG33k(m): 9:27pm On May 31, 2017
I'm stunned by your post but IMO, I'll love to learn how to jump before I learn how to fly.... Teach us how to open an offline register and login app before connecting to get info from server or else you're gonna twist things for we learners
Re: How To Develop Instant Android Chating App(social Network) by adenuga558(m): 11:06pm On May 31, 2017
SilverG33k:
I'm stunned by your post but IMO, I'll love to learn how to jump before I learn how to fly.... Teach us how to open an offline register and login app before connecting to get info from server or else you're gonna twist things for we learners
Am planing on how to make d app send instant message using json php mysql am thinking on refreshing d activity in background every 1second or milisecond
Re: How To Develop Instant Android Chating App(social Network) by Nobody: 3:22am On Jun 01, 2017
adenuga558:
Am planing on how to make d app send instant message using json php mysql am thinking on refreshing d activity in background every 1second or milisecond

the client's data?
Re: How To Develop Instant Android Chating App(social Network) by jidez007: 7:18am On Jun 01, 2017
adenuga558:
Am planing on how to make d app send instant message using json php mysql am thinking on refreshing d activity in background every 1second or milisecond
Polling for data every second is bad on a web app not to now talk of an Android app that has to be very smooth and data efficient.

Please teach us the normal way, the way you would do it on a production app.
Re: How To Develop Instant Android Chating App(social Network) by adenuga558(m): 9:06am On Jun 01, 2017
jidez007:

Polling for data every second is bad on a web app not to now talk of an Android app that has to be very smooth and data efficient.

Please teach us the normal way, the way you would do it on a production app.
json is lite weight and fast when it comes to load data online. am trying to use php mysql and json as d Api I don't want firebase or xmpp I want to make u ave full access on it
Re: How To Develop Instant Android Chating App(social Network) by donTee01(m): 12:37pm On Jun 01, 2017
adenuga558:

json is lite weight and fast when it comes to load data online. am trying to use php mysql and json as d Api I don't want firebase or xmpp I want to make u ave full access on it
Fire on
Re: How To Develop Instant Android Chating App(social Network) by SilverG33k(m): 2:10pm On Jun 01, 2017
adenuga558:
Am planing on how to make d app send instant message using json php mysql am thinking on refreshing d activity in background every 1second or milisecond

You can use FireBase to achieve this!!

.......

Refreshing every 1 seconds even when nobody is online is bad so make it 4 - 10 seconds WHEN at every 60seconds interval, there is a user online waiting to send message.

This means that it is when a user is online that you run a timer of 4 or 2 seconds interval, instead use a 1 minute interval to check if any user is online at all. Use a background service and Timer to continue running every time to fetch data and when there is a new message, display the message....
Re: How To Develop Instant Android Chating App(social Network) by adenuga558(m): 10:55am On Jun 09, 2017
Thread is still open

(1) (2) (Reply)

Which Php Framework Do You Use? / I Will Design And Programme Ponzi/mlm Website At Cheap Price / How To Hack Someone's Cell Phone

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2021 Oluwaseun Osewa. All rights reserved. See How To Advertise. 101
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.