GithubHelp home page GithubHelp logo

hotcoode / hoychatapp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iammert/hoychatapp

0.0 2.0 0.0 12.92 MB

Hoy app let you meet random people all over the world. It is already published on app market. But if you want to add some feature, you are free to steal anything.

Java 100.00%

hoychatapp's Introduction

hoyapp

Hoy app let you meet random people all over the world. It is already published on app market. But if you want to add some feature, you are free to steal anything. Note : It is not fully completed project. Just a hobby project which created couple days. There are many shortcoming.

Try out the application on the Android Market.

#SETUP

#step 1 App is using Parse api to push notification. First, you need to get client key and app id from Parse and replace it with below code APP_ID and CLIENT_KEY. Parse is simply let us to use push notification.

public class HoyApp extends Application {
    ...
    @Override
    public void onCreate() {
        super.onCreate();
        Parse.initialize(this,"APP_ID","CLIENT_KEY");
    }
    ...
}

#step 2 Second, this app is simply use two web services which are add new user to db and get random people from db. I will not share my db info with you but you can simply copy php files, edit with your db info and put them to your server.

Simply fetch 15 user from db.

<?php
		//Fill here with your info
		$hostname ="";
		$database ="";
		$username ="";
		$password ="";

		mysql_connect($hostname,$username,$password);

		mysql_select_db($database);

		$sql=mysql_query("SELECT * FROM user ORDER BY RAND() LIMIT 15");
		while($row=mysql_fetch_assoc($sql))
		$output['user'][]=$row;
		print(json_encode($output));
		mysql_close();
	
?>

Add new user to db.

<?php
		//Fill here with your info
		$hostname ="";
		$database ="";
		$username ="";
		$password ="";

		$con=mysqli_connect($hostname,$username,$password,$database);
		mysql_query("SET NAMES UTF8");
		// Check connection
		if (mysqli_connect_errno())
		{
		echo "Failed to connect to MySQL: " . mysqli_connect_error();
		}

		$sql="INSERT INTO user (user_id,image_url,name_surname,age,mac_adress)
		VALUES
			('$_POST[user_id]','$_POST[image_url]','$_POST[name_surname]','$_POST[age]','$_POST[mac_adress]')";

			if (!mysqli_query($con,$sql))
			{
				die('Error: ' . mysqli_error());
			}
	
	
	mysqli_close($con);
	?>

Better that i give you user table mapping because you need to create table on your mysql db.

//user_id primary key(INT), not auto increment.
user(user_id, image_url, name_surname, age, mac_adress)

#step 3

After you create you user table in your mysql db and put add_user.php, get_users.php files to FTP, your webservices seems ready to use.

public class ServerConstant {

    public static String URL_ADD_NEW = "add_new_person_to_db_url";
    public static String URL_GET_ALL = "get_random_people_from_db_url";

    ...

}

#step 4

This app uses facebook information of users. For this reason you need to create facebook app and put your app_id in string.xml file.

<string name="app_id">facebook_app_id_here</string>

hoychatapp's People

Contributors

iammert avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.