lundi 20 juillet 2015

Do i need a database like sqlite for gcm ccs chat implementation?

I'm implementing a chat application based on gcm via ccs.

I read the google docs i understood the basic working but i have a doubt in the database area.

Am i right for the following

Firstly create a server key which will be my server ,then connect to ccs and gcm, but what about database to store reg id's is it needed?like sqlite in following example

SmackCcsClient ccsClient = new SmackCcsClient();
    String databaseURL = "jdbc:sqlite:gcm.db";
try
{
    // Setup CCS client and create local SQLite database and tables if needed
    ccsClient.connect(userName, password);
    ConnectionSource connectionSource = new JdbcConnectionSource(databaseURL);
    userDao = DaoManager.createDao(connectionSource, User.class);
    TableUtils.createTableIfNotExists(connectionSource, User.class);
    notificationDao = DaoManager.createDao(connectionSource, NotificationKey.class);
    TableUtils.createTableIfNotExists(connectionSource, NotificationKey.class);
}
catch (XMPPException e)
{
    e.printStackTrace();
}
catch (SQLException e)
{
    e.printStackTrace();
}
}

}

Any suggestions appreciated.

Aucun commentaire:

Enregistrer un commentaire