hectorese1 / chat-examples-java

Sample code and apps for PubNub’s Chat Resource Center

Home Page:https://www.pubnub.com/developers/chat-resource-center/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PubNub Java Chat

Build Status

This repository contains sample code for a chat application built using the PubNub Android SDK.

Animal Forest Android Chat View Animal Forest Android Channel Details

Repository structure

Directory Description
app/examples/animal/forest/chat Source files for the Animal Forest Chat application.

Animal Forest Chat Application

Prerequisites

  • Android Studio 3.0+
  • PubNub SDK
  • A PubNub Chat account

Create a PubNub Account

To run this application you must obtain publish and subscribe keys from your PubNub Dashboard. If you don't already have an account, you can create one for free.

  1. Sign in to your PubNub Dashboard.

  2. Click Create New App. Give your app a name, and select Chat App as the app type. Select a region to store your user data (e.g. Portland). Click Create.

  3. Click your new app to open its settings, then click its keyset.

  4. Locate the Publish and Subscribe keys. You'll need these keys to include in this project.

Using your PubNub keys

Execute the following commands to add your publish and subscribe keys to your local copy of the app.

cd app/
echo PUB_KEY="\"YOUR_PUBNUB_PUB_KEY\"" >> gradle.properties
echo SUB_KEY="\"YOUR_PUBNUB_SUB_KEY\"" >> gradle.properties
echo app/gradle.properties >> ../.gitignore

This will also create a app/gradle.properties file, which is a good place to store confidential information.

Building and running the app

  1. Launch Android Studio. On the welcome screen, choose Open an existing Android Studio project.

  2. Select the root project folder, chat-examples-java/, and click Open.

  3. Wait for Gradle to download dependencies and sync the project. This could take several minutes.

  4. Choose Run > Run 'app', and pick the device on which you want to run the app. If necessary, create a new virtual device on which to run the app.

Further Information

For more information about this project, or how to create your own chat app using PubNub, please check out the PubNub Chat Documentation.

About

Sample code and apps for PubNub’s Chat Resource Center

https://www.pubnub.com/developers/chat-resource-center/

License:MIT License


Languages

Language:Java 95.9%Language:JavaScript 4.1%