This project contains QuickBlox Android SDK, that includes
- framework library jar
- snippets (shows main use cases of using this one)
- samples (separated samples for each QuickBlox module)
To start work you should just put library jar into your project and call desired methods.
Latest jar-packed framework file you can download from downloads page.
- Project page on QuickBlox developers section
- Start to learn SDK from Android Guide
- Framework reference in JavaDoc format
Android SDK is really simple to use. Just in few minutes you can power your mobile app with huge amount of awesome functions to store, pass and represent your data.
3. Add jar library to project libs folder.
Eclipse users: If you got 'Unable to execute dex: Java heap size' - try to upgrade eclipse.ini to https://groups.google.com/forum/?fromgroups=#!topic/phonegap/yWePvssyiLE
- Go to AndroidManifest.xml and add
<uses-permission android:name="android.permission.INTERNET" />
inside <manifest>
tag.
The common way to interact with QuickBlox can be presented with following sequence of actions:
- Initialize framework with application credentials
- Create session
- Login with existing user or register new one
- Perform actions with any QuickBlox data entities (users, locations, files, custom objects, pushes etc.)
QBSettings.getInstance().fastConfigInit("961", "PBZxXW3WgGZtFZv", "vvHjRbVFF6mmeyJ");
or step by step
QBSettings.getInstance().setApplicationId("961");
QBSettings.getInstance().setAuthorizationKey("PBZxXW3WgGZtFZv");
QBSettings.getInstance().setAuthorizationSecret("vvHjRbVFF6mmeyJ");
QBAuth.createSession(new QBCallbackImpl() {
@Override
public void onComplete(Result result) {
if (result.isSuccess()) {
// result comes here if authorization is success
}
}
});
First create (register) new user
// Register new user
QBUsers.signUp("indianajones", "indianapassword", new QBCallbackImpl() {
@Override
public void onComplete(Result result) {
if (result.isSuccess()) {
// result comes here if request has been completed successfully
}
}
});
then authorize user
// Login
QBUsers.signIn("indianajones", "indianapassword", new QBCallbackImpl() {
@Override
public void onComplete(Result result) {
if (result.isSuccess()) {
// result comes here if request has been completed successfully
}
}
});
Create new location for Indiana Jones
double lat = 25.224820; // Somewhere in Africa
double lng = 9.272461;
String statusText = "trying to find adventures";
QBLocation location = new QBLocation(lat, lng, statusText);
QBLocations.createLocation(location, new QBCallbackImpl() {
@Override
public void onComplete(Result result) {
if (result.isSuccess()) {
// result comes here if authorizations is success
}
}
});
or put Holy Grail into storage
File file = new File("holy_grail.txt");
Boolean fileIsPublic = true;
QBContent.uploadFileTask(file, fileIsPublic, new QBCallbackImpl() {
@Override
public void onComplete(Result result) {
if (result.isSuccess()) {
// file has been successfully uploaded
}
}
});
Java Framework provides following services to interact with QuickBlox functions (each service is represented by model with suite of static methods):
- QBAuth
- QBUsers
- QBCustomObjects
- QBLocations
- QBContent
- QBRatings
- QBMessages
- QBChat