Giter VIP home page Giter VIP logo

quickblox-android-sdk's Introduction

Discord server

QuickBlox Android SDK

This project contains:

Overview

QuickBlox is a communications service provider. The platform provides chat using the XMPP protocol, WebRTC signaling for video/voice calling and API for sending push notifications. It provides a user management system, data storage and more.

Sample structure

Each "NEW" sample is an independent project, which contains final dependencies and all "Utils" and "Helpers" are included into it to be more understandable and clever. Each sample shows how to create your own project with QuickBlox SDK, and how to use it to extend your existing project.

Each "OLD" sample depends on the Sample-Core module, which contains mutual dependencies such as CoreApp, BaseActivity, BaseListAdapter and other useful utils such as ImagePicker, KeyboardUtils, NotificationUtils, etc. Also the Sample-Core module keeps common resources colors, strings, dimens and others. It makes your code more clean and clear, and also more object-oriented. In addition the Samples have been renewed with up-to-date design.

How to run samples

To run samples on Android Studio go to menu File - Import Project. Select path to sample, select Use default gradle wrapper(recommended) and click OK.

Configure sample credentials

To create Quickblox account (if you don't have one) and find your own credentials you should visit our 5 minute guide

  • New samples
    • To set your own app credentials you should open App.java (or App.kt if you have downloaded the Kotlin sample) and paste the credentials into the values of constants:

New Samples Credentials

  • Old samples
    • To set your own app credentials for the sample just update configuration file qb_config.json inside appropriate sample project in assets folder:

Old Samples Credentials

  • To set additional sample settings use sample_config.json file inside assets folder.

Connect SDK to your existing apps

To get the QuickBlox SDK project running you will need to have installed Android Studio and Maven.

The repository https://github.com/QuickBlox/quickblox-android-sdk-releases contains binary distributions of QuickBlox Android SDK and manual on how to connect SDK to your project. Check it out.

Android Studio issues

If you can’t successfully build the gradle after updating to some of the Quickblox SDK version, try to resolve all errors appearing in Gradle Console (but not in code emphasized red!) It may occur because of some versions of Android Studio can’t completely resolve import dependencies while a project has internal errors.

If you still have problems with importing the SDK library from remote repo, go to the next section.

Add quickblox dependency as local repository

  1. Create local folder, for example /Users/igor/workspace/quickblox

  2. Clone or download the repository from https://github.com/QuickBlox/quickblox-android-sdk-releases

  3. Put the downloaded quickblox-android-sdk-releases-master into the created quickblox folder.

  4. In project replace build.grade file

maven {
            url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
        }

to

maven {
            url= "file://Users/igor/workspace/quickblox/quickblox-android-sdk-releases-master"
        }

and use any version of quickblox-android-sdk.

Customize Proguard in Android Studio

To use Proguard in your project create proguard-rules.pro file and put below rules for Quickblox modules :

##---------------Begin: proguard configuration for Gson  ---------- 
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature

# For using GSON @Expose annotation
-keepattributes *Annotation*

# Gson specific classes
-keep class sun.misc.Unsafe { *; }
#-keep class com.google.gson.stream.** { *; }

# Application classes that will be serialized/deserialized over Gson
-keep class com.quickblox.core.account.model.** { *; }

##---------------End: proguard configuration for Gson  ----------

##---------------Begin: proguard configuration for quickblox  ----------

#quickblox core module
-keep class com.quickblox.auth.parsers.** { *; }
-keep class com.quickblox.auth.model.** { *; }
-keep class com.quickblox.core.parser.** { *; }
-keep class com.quickblox.core.model.** { *; }
-keep class com.quickblox.core.server.** { *; }
-keep class com.quickblox.core.rest.** { *; }
-keep class com.quickblox.core.error.** { *; }
-keep class com.quickblox.core.Query { *; }

#quickblox users module
-keep class com.quickblox.users.parsers.** { *; }
-keep class com.quickblox.users.model.** { *; }

#quickblox messages module
-keep class com.quickblox.messages.parsers.** { *; }
-keep class com.quickblox.messages.model.** { *; }

#quickblox content module
-keep class com.quickblox.content.parsers.** { *; }
-keep class com.quickblox.content.model.** { *; }

#quickblox chat module
-keep class com.quickblox.chat.parser.** { *; }
-keep class com.quickblox.chat.model.** { *; }
-keep class org.jivesoftware.** { *; }
-keep class org.jxmpp.** { *; }
-dontwarn org.jivesoftware.smackx.**

#quickblox videochat-webrtc module
-keep class org.webrtc.** { *; }

##---------------End: proguard configuration for quickblox  ----------

##---------------End: proguard configuration ----------

To fix errors and force ProGuard to keep certain code, add a -keep line in the ProGuard configuration file.

For example:
-keep public class MyClass

Alternatively, you can add the @Keep annotation to the code you want to keep. Adding @Keep on a class keeps the entire class as-is. Adding it on a method or field will keep the method/field (and its name) as well as the class name intact.

Documentation

Questions and feedback

Please ask questions, requests for help etc.

License

BSD

quickblox-android-sdk's People

Contributors

alexparvus1 avatar alisandr avatar andrii-dmytrenko avatar bogatovevgeniy avatar dehimb avatar dmitripiryatenets avatar ishaforenko avatar ishaforenkoqb avatar katiatereshchenkova avatar kirilltolmachev avatar romanpronin avatar sergey-fedunets avatar soulfly avatar sshaforenkoqb avatar tatanka987 avatar vdovbnya-qb avatar vfite avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quickblox-android-sdk's Issues

QuickBlox Video sample does not work

I have some trouble with the OnQBVideoChatListener in QuickBlox, the two methods onOpponentVideoDataReceive and onOpponentAudioDataReceive are never called. Here is how I implemented the cameraView and the opponentView. It's basically the same as the sample app given here[1]. I have tried to run the sample Video chat app on my phone and tablet however the same issue occures and only the cameraView gets updated. The opponent view is always black. Is there anyone who has experienced the same trouble and have a solution ?

please refer to http://stackoverflow.com/questions/24892652/quickblox-videochat-demo-onopponentvideodatareceived-not-called for code :) Thanks so much

QuickBlox Session Create freezes my App

Here is how i'm using it to sign in a user to private chat

QBSettings.getInstance().fastConfigInit("xxxxx", "xxxxxxxxxxxx", "xxxxxxxxxxxxxx");
        QBAuth.createSession(new QBCallbackImpl() {
            @Override
            public void onComplete(Result result) {
                Log.d("", "success when login-1");
                // result comes here
                // check if result success
                if (result.isSuccess()) {
                    // do stuff you need
                        Log.d("", "success when login0");

                    QBUsers.signIn(user, new QBCallbackImpl() {
                        @Override
                        public void onComplete(Result result) {
                            Log.e("login qb", "success when login00");
                            // result comes here
                            // check if result success
                            if (result.isSuccess()) {
                                Log.d("", "success when login1");
                                // do stuff you need
                                QBUserResult qbUserResult = (QBUserResult) result;
                                MyApplication appy=(MyApplication)LoggedIn_MainActivity.this.getApplication();
                                appy.setQb_id(qbUserResult.getUser().getId());
                                SmackAndroid.init(loggedinmainactivity);

                                // login to Chat
                                QBChatService.getInstance().loginWithUser(user, new SessionCallback() {
                                    @Override
                                    public void onLoginSuccess() {
                                        Log.d("", "success when login");
                                   //  Toast.makeText(Chat_Activity.this.getApplicationContext(), "login created", Toast.LENGTH_SHORT).show();


                                     chat = QBChatService.getInstance().createChat();

                                    success_chat_login=true;
                                         Log.d("", "success when login");

                                    }



                                    @Override
                                    public void onLoginError(String error) {
                                        Log.e("", "error when login"+error);
                                    }
                                });

                                     }else {
                                 AlertDialog.Builder dialog = new AlertDialog.Builder(loggedinmainactivity);
                                 dialog.setMessage("Error(s) occurred. Look into DDMS log for details, " +
                                         "please. Errors: " + result.getErrors()).create().show();
                             }
                        }
                    });
                }else{
                    Toast.makeText(getApplicationContext(), "unable to create session", Toast.LENGTH_SHORT).show();

                }
            }
        });

it works fine in all cases except when user closes the app forcibly.
I'm doing the above one in one of the activities and if the user force closes the app when he is this activity then it works fine when he reenters the app but when user force closes the app when he is in different activity(i'm using the chat instance from previous activity here) , the app froze when user restarts the app after creating the session i.e, it prints "success when login0" and froze at QBUsers.signIn and it's never letting me pass through that point until i uninstall the complete app and reinstall it...

Any help please

Chat Server is temporarily unavailable

We've been using the 2.0 SDK for a while now but using the pull_all to remove occupants from a Dialog sometimes gives us this message error.
It happens when the user is the last occupant of the dialog. I can check with a condition to see if I'm the last user and delete instead of update the dialog, but it should do the work on the API.
The error message has nothing to do with the actual erroneous action.

Getting Owner of a Dialog

I can't seem to find a way of knowing who owns a Dialog.
XMPP allows you to know and change the Owner of a given XMPP MUC, and I'm guessing that's what QuickBlox uses at a lower level, but there's no method to access it in the API.
I recall somewhere in QuickBlox site saying that you would add more info to the getRoomInfo method but that method is gone in Chat 2.0
Using Dialogs in conjunction with CustomObjects just to enable Owners seems like a lot of overhead for something that we should have access to already (when querying for Dialogs).

Constantly track the Users offline/online in a Geofence

Hi Team,

I m using Quickblox latest version Android API. I m stumbled upon a Use Case where the User Creates a group with other Users and adds a Geofence for a particular Location ( POI ) . When ever group members are entered or exited the Geofence it should Alert the Group Members . Also , needs to show the other group member's location constantly.

I was trying to achieve the same with the GoogleClientAPI ( latest PlayServices API ) and GeofecingAPI from Google with the Custom Classes from Quickblox and QBLOcations. But manually trying to achieve this makes constant server updations which makes App heavy.
Do we have anything specific in Quickblox Android API for constantly knowing the other user's location and to trigger a geofence alert. through API calls?

Please let me know about the same since that can avoid lots of Background services which monitor and update the current locations .

Thanks in advance
Jobi

SplashActivity\res\values\themes.xml

Hi,
Getting error:
error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat'.

not able to build. Have imported sdk\extras\android\support\v7\appcompat and add the library in the app.

How to resolve the error ?

Thanks

Why when the XMPP connection disconnect the presence type user change from unavailable to available

How to log out correctly when I close the application and stop the ping execute?

When I run the logout below each line code work perfect,

But if I run the code lines:

Presence presence = new Presence(org.jivesoftware.smack.packet.Presence.Type.unavailable);
presence.setStatus(connection.getUser() + status);
connection.sendPacket(presence);
I get user offline/unavailable.//But the connection alive

Then I want to disconnect the connection so I run the line code.

connection.disconnect();//I get user online/available and connection die.
I have more one problem when the connection die i get something like ping.

11-13 21:55:02.820: D/SMACK(7399): 09:55:02 PM SENT (1385370112): 11-13 21:55:32.820: D/SMACK(7399): 09:55:32 PM SENT (1385370112): 11-13 21:56:02.820: D/SMACK(7399): 09:56:02 PM SENT (1385370112): 11-13 21:56:32.820: D/SMACK(7399): 09:56:32 PM SENT (1385370112): 11-13 21:57:02.820: D/SMACK(7399): 09:57:02 PM SENT (1385370112): 11-13 21:57:32.820: D/SMACK(7399): 09:57:32 PM SENT (1385370112): 11-13 21:58:02.824: D/SMACK(7399): 09:58:02 PM SENT (1385370112): 11-13 21:58:32.824: D/SMACK(7399): 09:58:32 PM SENT (1385370112): 11-13 21:59:02.824: D/SMACK(7399): 09:59:02 PM SENT (1385370112): 11-13 21:59:32.824: D/SMACK(7399): 09:59:32 PM SENT (1385370112):
public void logOut(boolean unavailable, String status) {

if (isConnectionAlive() || reConnectAndAuth()) {
    Presence presence = new Presence(org.jivesoftware.smack.packet.Presence.Type.unavailable);
    presence.setStatus(connection.getUser() + status);
    connection.sendPacket(presence);
    pm = null;
    connection.disconnect();
   //iscNNcet();
    Log.w("LogOut","LogOut");
}

}

Deleting Private Chat Dialog

Is there a way to delete a Private Chat Dialog?

I am using Android SDK 2.0 QBPrivateChatManager deleteDialog and getting a 200 response.
After doing that and making this request GET https://api.quickblox.com/chat/Dialog.json
The Dialog that I deleted is not in the response which is good
However, when I start a chat with the same user that was in the Dialog I deleted, all the old chat messages reappear.

Any help with this issue would be greatly appreciated. Thanks

There is no way to load more than 10 items for QBPlace

For QBLocations.getLocations I can pass QBLocationsBuilder object to tell system items per page and current page.
But for QBLocations.getPlaces there is no method to do it. So user can load only 10 objects there..
Also it will be good if you add ability to filter QBPlaces by distance too (as is done in getLocations now).

Adding Location Type to the CustomObject

Hi ,

Please let me know how to add a location type value to the CustomObject.

I tried as follows

HashMap<String, Object> fields = new HashMap<String, Object>();
fields.put("Name", name);
fields.put("Location",loc);//loc is of type Location
final QBCustomObject customObject = new QBCustomObject();
//customObject.put("Location",loc);
customObject.setClassName("MYLocationTest");
customObject.setFields(fields);
QBCustomObjects.createObject(customObject)
but its not working. its shows [0,0] in the QB Dashboard.
In the documentation it specifies to add location as array tried that too but is not working

Please let me know if something I m missing or doing it in a wrong way?

Cannot execute app

Hi,

Thanks for this examples. I have a problem when I try to run chat_v2, I can't run the application. It gives me an error like:

SplashActivity] Dx bad class file magic (cafebabe) or version (0033.0000)
...while parsing com/quickblox/internal/module/locations/query/QueryDeletePlace.class
...while processing com/quickblox/internal/module/locations/query/QueryDeletePlace.class

Any ideas?

thanks again!

onOpponentVideoDataReceive & onOpponentAudioDataReceive are not called for VideoChat in Android

Hi, I am working on Eclipse and building the app for video chat on it instead of studio. Now I made the entire code work in eclipse by view this: http://quickblox.com/developers/Sample-videochat-android . But when implemented, everything worked fine except that onOpponentVideoDataReceive & onOpponentAudioDataReceive were not called. I can make a Call and receive it too, but cannot see opponent's part of video from my app. I also copied the "libilbc-codec.so" to "\libs\armeabi" path and included Native support too.

Can you please suggest me any solution as I cannot change IDE to Studio in my app and am kind of stuck in Eclipse. Please help me out on this part.

receive chat for every one

the privatechatmanager you have given,it is for only a private chat. how can i listen for chat always when my app is open after creating chat session??

currently i am getting chat for every one in log cat by your SDK. but i cant figure out the way to get it in my code. please help me out. i am stuck at it for the past 7 days.

Problems with lags and echoes in calls including an Android device

Are there any plans to solve the audio problems with calls including an Android device?
I'm experiencing issues of major lags on Android devices as well as metally echoes from an Android device to the other user.
In the iOS-Logs we can see that the audio is obviously be taken care of: Error: "Bad audio data, length x".

Would be great if something similar will be implemented in the Android SDK :-)

VideoChat can't set camera quality

Dear Sir,

I try to run the VideoChat sample, everything is ok except there is no way to set camera quality.

From the sample code tutorial page, we should be able to call cameraView.setCameraQuality(CameraQuality.HIGH).
But there is no "setCameraQuality" method for CameraView class.
The default quality is not good enough (maybe only 360p?)

The SDK version I used is quickblox-android-1.2.2.jar
Any suggestions?

Thanks!

How to add location to location field of a custom class

Hi ,

From the documentation it says that "Location (array with 2 elements: longitude, latitude)" as the description for the location field. I tried to add a location type with Lat and Longt into the Customfield object but its inserted as Location[0,0]. What can be the correct way to do it . Please let me know.

Thanks ,

chat sample issue

Good evening,

I am Andrea, an italian university student trying to learn how to use Quickblox Chat.
I followed your examples and tutorials online but I found a possible bug.
When I write a chat message to another person, and when this person replies we all get the messages on the left side, with orange bubble, as it would be only if I was sending. (You can see the screenshot on the attached file to better understand)

I tried to separate the boolean control you made before setting the alignment, and it kinda works, but it's not responsive as the first one.

This is the line I'm talking about: (Line 70, ChatAdapter.java)
setAlignment(holder, chatMessage.getSenderId() == ((ApplicationSingleton)context.getApplication()).getCurrentUser().getId());

The only thing I changed are the credentials and the user name and password.

Do you have my same issue or am I the only one getting this strange visualization error?

Thank you for your kind attention,

Arrivederci!

Andrea Montanari

base Unexpected signature

Hi,

I am migrating from 1.2 to 2.0 because i am unable to logout already login chat user. I have download sample code for chat 2.0 and i have replace app id, auth secret and auth key in my sample app along with new user login and password but creating session it returns base Unexpected signature. what could be the reason? Either quide me to logout already login user using 1.2 sdk or help me with this.

Push Notification Create QB Event throwing NPE when trying to pass HashMap to event.setMessage() method.

Hi ,

When I tried to add push notification for an activity it was not working for a HashMap type. Its working fine when I m setting the event message type as a String . Below are the code tried and NPE thrown .

Code:

    QBEvent event = new QBEvent();
    event.setUserIds(userIds);
    event.setType(QBEventType.ONE_SHOT);
    event.setEnvironment(QBEnvironment.DEVELOPMENT);
    event.setNotificationType(QBNotificationType.PUSH);


    //
    HashMap<String, String> data = new HashMap<String, String>();
    data.put("Name", "Meetup Created!!!");
    data.put("ParentId",parentId.toString());
    event.setMessage(data);
    //event.setMessage("Meetup Created");// works fine here

    QBMessages.createEvent(event, new QBEntityCallbackImpl<QBEvent>() {
        @Override
        public void onSuccess(QBEvent qbEvent, Bundle args) {
            Log.i("MessageSent", ">>> new event: " + qbEvent.toString());

        }

        @Override
        public void onError(List<String> errors) {

            System.out.println("MessageError" + errors.toString());
        }
    });

Error Log:

java.lang.NullPointerException
at it.sauronsoftware.base64.Base64.encode(Unknown Source)
at com.quickblox.messages.model.QBEvent.getMessageEncoded(QBEvent.java:305)
at com.quickblox.messages.query.QueryCreateEvent.setParams(QueryCreateEvent.java:44)
at com.quickblox.core.query.Query.setupRequest(Query.java:119)
at com.quickblox.core.query.Query.performInBgAsyncWithDelegate(Query.java:111)
at com.quickblox.core.query.Query.performAsyncWithCallback(Query.java:216)
at com.quickblox.messages.QBMessages.createEvent(QBMessages.java:421)

Please let me know if I m missing out something on this.
Thanks ,
Jobin

Error code 422 (Error when login, check test users login and password)

Hi,

i have created app on quickblox. users are created successfully but when i try to creates session with : QBAuth.createSession(login, password, new QBCreateSessionCallback(password));
with some users it throws erros code 422. what could be the reason.

I have imported github sample video chat app.

DexMerger: method ID not in [0, 0xffff]: 65536

When We integrate jar + android-support - play services number of methods is close to limit of dex file.
Methods generate by jar are:
jars/quickblox-android-1.1.0.jar
34330

We know that quickblox implements guava but are you guys thinking of publishing a lighter jar?

How to create open group dialog

I am trying to create open group dialog where any user can join and start chatting.But I am not able to do.
Write now i am able to create the group but its kind of private group where group creator only add the another user. I want open group where any one can join without anyones permission.

Can we make custom group chat using Custom Objects?

I would like to make group chat which have the following features:

  1. Any user can create a group chat
  2. If any user would like to join this group then they just put the group code and join this group.
  3. After that only those member chat with each other
  4. Any user can leave any time from this group.
  5. Only admin has access to delete the group, block any person

So, how can I achive this goal through your android 2.o beat version code, because all the study documentation are based on old version.

Android App does not get compiled when integrating Quickblox. Get " Unable to execute dex: method ID not in [0, 0xffff]: 65536" Error !!

Hi,
I am developing an Android app in which I am integrating few libraries. The code works perfect before integrating quickblox in it. I will be needing quickblox for textual and video chatting in my app.

Now as soon as I integrate quickblox and run the code in Eclipse, I get following error:

[2014-09-16 13:07:37 - Dex Loader] Unable to execute dex: method ID not in [0, 0xffff]: 65536
[2014-09-16 13:07:37 - xxxx] Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536

Later I noticed that the library SDK-android.jar for Quickblox gets heavier than 4Mb.

Can you suggest any method for resolving this method and yet having quickblox in my app ? Maybe you can suggest any light weight library for integrating. Please spread some light in this matter.

Thank You in Advance.

Sample Location ClassNotFoundException

i imported the sample project using Eclipse but doesnt work.

E/AndroidRuntime(8563): FATAL EXCEPTION: main
E/AndroidRuntime(8563): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.quickblox.sample.location/com.quickblox.sample.location.activities.SplashActivity}: java.lang.ClassNotFoundException: Didn't find class "com.quickblox.sample.location.activities.SplashActivity" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.quickblox.sample.location-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.quickblox.sample.location-1, /vendor/lib, /system/lib]]
E/AndroidRuntime(8563): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2277)
E/AndroidRuntime(8563): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2403)
E/AndroidRuntime(8563): at android.app.ActivityThread.access$600(ActivityThread.java:165)
E/AndroidRuntime(8563): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1373)
E/AndroidRuntime(8563): at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(8563): at android.os.Looper.loop(Looper.java:194)
E/AndroidRuntime(8563): at android.app.ActivityThread.main(ActivityThread.java:5391)
E/AndroidRuntime(8563): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(8563): at java.lang.reflect.Method.invoke(Method.java:525)
E/AndroidRuntime(8563): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
E/AndroidRuntime(8563): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
E/AndroidRuntime(8563): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(8563): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.quickblox.sample.location.activities.SplashActivity" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/com.quickblox.sample.location-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.quickblox.sample.location-1, /vendor/lib, /system/lib]]
E/AndroidRuntime(8563): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
E/AndroidRuntime(8563): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
E/AndroidRuntime(8563): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
E/AndroidRuntime(8563): at android.app.Instrumentation.newActivity(Instrumentation.java:1119)
E/AndroidRuntime(8563): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)
E/AndroidRuntime(8563): ... 11 more

NoClassDefFoundError when try to run sample-chat

After downloading Quickblox sample, I import sample-chat project, add required library projects (android-support-v7-appcompat and pull-to-refresh) as well as JARs (quickblox-android-sdk-chat-2.0.jar and quickblox-android-sdk-core-2.0.jar) as guide from http://quickblox.com/developers/Android_XMPP_Chat_Sample#Eclipse_IDE

I see project can be compiled successful without error. However when run app, right after enter Splash, I receive many warnings first

11-04 21:37:16.665: E/dalvikvm(9198): Could not find class 'com.quickblox.users.model.QBUser', referenced from method com.quickblox.sample.chat.ApplicationSingleton.addDialogsUsers
11-04 21:37:16.665: W/dalvikvm(9198): VFY: unable to resolve check-cast 1281 (Lcom/quickblox/users/model/QBUser;) in Lcom/quickblox/sample/chat/ApplicationSingleton;
11-04 21:37:16.670: W/dalvikvm(9198): VFY: unable to find class referenced in signature (Lcom/quickblox/users/model/QBUser;)
11-04 21:37:16.670: W/dalvikvm(9198): VFY: unable to find class referenced in signature (Lcom/quickblox/chat/model/QBDialog;)
11-04 21:37:16.670: I/dalvikvm(9198): Could not find method com.quickblox.chat.model.QBDialog.getOccupants, referenced from method com.quickblox.sample.chat.ApplicationSingleton.getOpponentIDForPrivateDialog
11-04 21:37:16.670: W/dalvikvm(9198): VFY: unable to resolve virtual method 9782: Lcom/quickblox/chat/model/QBDialog;.getOccupants ()Ljava/util/ArrayList;
11-04 21:37:16.670: W/dalvikvm(9198): VFY: unable to find class referenced in signature (Lcom/quickblox/users/model/QBUser;)
11-04 21:37:16.670: E/dalvikvm(9198): Could not find class 'com.quickblox.users.model.QBUser', referenced from method com.quickblox.sample.chat.ApplicationSingleton.setDialogsUsers
11-04 21:37:16.670: W/dalvikvm(9198): VFY: unable to resolve check-cast 1281 (Lcom/quickblox/users/model/QBUser;) in Lcom/quickblox/sample/chat/ApplicationSingleton;
11-04 21:37:16.675: I/dalvikvm(9198): Could not find method com.quickblox.chat.QBChatService.setDebugEnabled, referenced from method com.quickblox.sample.chat.ui.activities.SplashActivity.onCreate
11-04 21:37:16.675: W/dalvikvm(9198): VFY: unable to resolve static method 9757: Lcom/quickblox/chat/QBChatService;.setDebugEnabled (Z)V

then crash with errors:

11-04 21:37:16.940: E/AndroidRuntime(9198): FATAL EXCEPTION: main
11-04 21:37:16.940: E/AndroidRuntime(9198): java.lang.NoClassDefFoundError: com.quickblox.chat.QBChatService
11-04 21:37:16.940: E/AndroidRuntime(9198): at com.quickblox.sample.chat.ui.activities.SplashActivity.onCreate(SplashActivity.java:41)
11-04 21:37:16.940: E/AndroidRuntime(9198): at android.app.Activity.performCreate(Activity.java:5133)
11-04 21:37:16.940: E/AndroidRuntime(9198): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
11-04 21:37:16.940: E/AndroidRuntime(9198): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2293)
11-04 21:37:16.940: E/AndroidRuntime(9198): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2389)
11-04 21:37:16.940: E/AndroidRuntime(9198): at android.app.ActivityThread.access$600(ActivityThread.java:153)
11-04 21:37:16.940: E/AndroidRuntime(9198): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1269)

Any suggest how to fix it?

Switch camera doesn't work on Opponent receiver

Hello,

When a user switchs his camera, the receiver has a freezed view of the sender's previous camera. When the first user switchs again, the receiver gets user's camera back.

I use the 1.2.4 Quickblox's Android SDK.

To switch user's camera, I use this function :

public void switchCam(View v) {
        cameraView.switchCamera();
}

On Group Chat a new user can not be able to join exisitng Group.

QBDialog dialogToUpdate = new QBDialog();
dialogToUpdate.setDialogId("dialog_id");
QBCustomObjectUpdateBuilder requestBuilder = new QBCustomObjectUpdateBuilder();
requestBuilder.push("occupants_ids", 1720008);

QBChatService.getInstance().getGroupChatManager().updateDialog(dialogToUpdate, requestBuilder, new QBEntityCallbackImpl()
{
@OverRide
public void onSuccess(QBDialog dialog, Bundle args)
{
Log.d("Dialog Update details", "dialog: " + dialog);
}
@OverRide
public void onError(List errors)
{
AlertDialog.Builder dialog = new AlertDialog.Builder(JoinGroupActivity.this);
dialog.setMessage("dialog creation errors: " + errors).create().show();
}
});

But it gives the result '{"errors":["You don't have appropriate permissions to perform this operation"]}'

NPE while fetching the content blob

HI ,

I was trying to update a profile pic ( avatar ) for the user .

fileId is checked and has value which is same as BLOBID in the web dashboard.
QBContent.downloadFileTask(fileId, new QBEntityCallback(){

        @Override
        public void onSuccess(InputStream inputStream, Bundle params) {
            byte[] content = params.getByteArray(com.quickblox.core.Consts.CONTENT_TAG);
            InputStream is = inputStream;
            avatarImgView.setImageBitmap(BitmapFactory.decodeStream(is));
            avatar_loadingPanel.setVisibility(View.GONE);
            changeAvatarBtn.setEnabled(true);
           // String contentFromFile = HelperUtils.getContentFromFile(inputStream);
           // Log.i("ShowUserActivity", "file downloaded: "+contentFromFile);
            Log.i("ShowUserActivity", "params: " + params);
        }

        @Override
        public void onSuccess() {

        }

        @Override
        public void onError(List<String> errors) {
            System.out.println("downloadFileIDError:" + errors.toString());
            //handleErrors(errors);
        }
    });

Response and Request Load :

=== REQUEST ==== a1e0f7d4-c728-409c-9465-3aff81674839 ===
REQUEST
GET https://api.quickblox.com/blobs/4b81737293db48ac92b1831fc7bfb37700.json
HEADERS
QuickBlox-REST-API-Version=0.1.1
QB-SDK=Android 2.0
QB-Token=4defd954a968bbb9dcc48dd5454313b49fe89001
PARAMETERS
INLINE
GET https://api.quickblox.com/blobs/4b81737293db48ac92b1831fc7bfb37700.json
12-16 01:48:22.779 10981-10981/technovibe.zone D/QBASDK﹕ *********************************************************
*** RESPONSE ** a1e0f7d4-c728-409c-9465-3aff81674839 ***
STATUS : 412
HEADERS
Access-Control-Allow-Origin=

Cache-Control=no-cache
Connection=keep-alive
Content-Type=application/json; charset=utf-8
Date=Mon, 15 Dec 2014 20:18:22 GMT
QB-Token-ExpirationDate=2014-12-15 22:18:12 UTC
QuickBlox-REST-API-Version=0.1.1
Server=nginx/1.0.15
Status=412 Precondition Failed
Transfer-Encoding=chunked
X-Rack-Cache=miss
X-Request-Id=5af28754be469a25c9f20265b8b7b2d0
X-Runtime=0.015035
X-UA-Compatible=IE=Edge,chrome=1
BODY
'{"errors":{"base":["The file you are trying to download has not been uploaded properly"]}}'

It was working previously . WIll you please let me know if something wrong ?

setName method for private dialog not working

I am settting a name to private dialog using setName method but on success I am getting null.

  QBDialog dialogToCreate = new QBDialog();
  dialogToCreate.setName("Pramod");

      dialogToCreate.setType(QBDialogType.PRIVATE);
  dialogToCreate.setPhoto(db.getUrl());
    ArrayList<Integer> userIds=new ArrayList<Integer>();

  userIds.add(riderChatId);



  dialogToCreate.setOccupantsIds(userIds);

  try {
      QBChatService.getInstance().getGroupChatManager().createDialog(dialogToCreate, new QBEntityCallbackImpl<QBDialog>() {
          @Override
          public void onSuccess(QBDialog dialog, Bundle args) {

              Toast.makeText(getApplicationContext(), dialog.getUserId()+" "+dialog.getName(),                Toast.LENGTH_SHORT).show();

          }

          @Override
          public void onError(List<String> errors) {

          }
      });

}

java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread.

java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. Make sure your adapter calls notifyDataSetChanged() when its content changes. [in ListView(2131296377, class android.widget.ListView) with Adapter(class com.sc.triumph.chat.adapters.PrivateChatAdapter)]
at android.widget.ListView.layoutChildren(ListView.java:1565)
at android.widget.AbsListView.onLayout(AbsListView.java:2149)
at android.view.View.layout(View.java:15140)
at android.view.ViewGroup.layout(ViewGroup.java:4867)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1160)
at android.view.View.layout(View.java:15140)
at android.view.ViewGroup.layout(ViewGroup.java:4867)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1160)
at android.view.View.layout(View.java:15140)
at android.view.ViewGroup.layout(ViewGroup.java:4867)

I am getting this exception if i start chating with another user as fast as possible after few messages i am getting this exception

Steps to Reprodeuce this issue-

  1. start chating with opponent/another user.
  2. send messages as fast as possible.
  3. tell opponent/another user to whom you are going to chat to do the same.

Image not uploaded properly in Content Module.

Hi ,

Was going through a strange error while trying to upload profile pic through Content Module.

The record was created with the Name , owner , id field etc. but the Status shows "Not Uploaded" and the actual image was not there. But the Response shows status 201 and success.

Below are the Request and Response

=== REQUEST ==== 675e2622-9ea4-4e01-ada1-35db475eac6b ===
REQUEST
POST http://qbprod.s3.amazonaws.com
HEADERS
QuickBlox-REST-API-Version=0.1.1
QB-SDK=Android 2.0
QB-Token=63f299cba41661683dbe8589386d49ba38bb0c10
PARAMETERS
INLINE
POST http://qbprod.s3.amazonaws.com
12-16 13:06:02.296 29001-29001/technovibe.zone D/QBASDK﹕ *********************************************************
*** RESPONSE *** 675e2622-9ea4-4e01-ada1-35db475eac6b ***
STATUS : 201
HEADERS
Content-Length=269
Content-Type=application/xml
Date=Tue, 16 Dec 2014 07:36:02 GMT
ETag="ab26aaba3ed0007fea249a099f8a6f76"
Location=http://qbprod.s3.amazonaws.com/b61107bcf38b4c6a981dde803c53325f00
Server=AmazonS3
x-amz-id-2=ASewxl+PLIhCuMNgGBqlDNQSmBxMJFKlIP1/anWtPcu8DpqaWt0+ys6q/Ik6yxpnQYyTdCD48kQ=
x-amz-request-id=DB216273605E0A37
BODY
'
http://qbprod.s3.amazonaws.com/b61107bcf38b4c6a981dde803c53325f00qbprodb61107bcf38b4c6a981dde803c53325f00"ab26aaba3ed0007fea249a099f8a6f76"'

Can you please check the same and let me know .

PS : this was working perfectly till a couple of weeks back .

Loading all online users in my QuickBlox account.

How can i display all the user available in an account,cause i noticed anytime i add a new user, the user cannot see all existing users the DialogActivity is just empty, and all existing users cannot see the new user too.

Lets assume i have a ListView that list all available users in my account, and any new users of the app will be updated in the ListView, so what do i need to add or change in the below code?

QBChatService.getChatDialogs(null, customObjectRequestBuilder, new QBEntityCallbackImpl>() {     @Override public void onSuccess(final ArrayList dialogs, Bundle args) {

        // collect all occupants ids
        //
        List<Integer> usersIDs = new ArrayList<Integer>();
        for(QBDialog dialog : dialogs){
            usersIDs.addAll(dialog.getOccupants());
        }

        // Get all occupants info
        //
        QBPagedRequestBuilder requestBuilder = new QBPagedRequestBuilder();
        requestBuilder.setPage(1);
        requestBuilder.setPerPage(usersIDs.size());
        //
        QBUsers.getUsersByIDs(usersIDs, requestBuilder, new QBEntityCallbackImpl<ArrayList<QBUser>>() {
            @Override
            public void onSuccess(ArrayList<QBUser> users, Bundle params) {

                // Save users
                //
                ((ApplicationSingleton)getApplication()).setDialogsUsers(users);

                // build list view
                //
                buildListView(dialogs);
            }

            @Override
            public void onError(List<String> errors) {
                AlertDialog.Builder dialog = new AlertDialog.Builder(DialogsActivity.this);
                dialog.setMessage("get occupants errors: " + errors).create().show();
            }

        });
    }

 void buildListView(List<QBDialog> dialogs){
    final DialogsAdapter adapter = new DialogsAdapter(dialogs, DialogsActivity.this);
    dialogsListView.setAdapter(adapter);

    progressBar.setVisibility(View.GONE);

    // choose dialog
    //
    dialogsListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            QBDialog selectedDialog = (QBDialog)adapter.getItem(position);

            Bundle bundle = new Bundle();
            bundle.putSerializable(ChatActivity.EXTRA_DIALOG, (QBDialog)adapter.getItem(position));

            // group
            if(selectedDialog.getType().equals(QBDialogType.GROUP)){
                bundle.putSerializable(ChatActivity.EXTRA_MODE, ChatActivity.Mode.GROUP);

            // private
            } else {
                bundle.putSerializable(ChatActivity.EXTRA_MODE, ChatActivity.Mode.PRIVATE);
            }

            // Open chat activity
            //
            ChatActivity.start(DialogsActivity.this, bundle);
        }
    });
}

Using distance search with QBLocationRequestBuilder returns 500 error

When I try to make a distance search with the following code, I automatically get a 500 error with the message « We're sorry, but something went wrong (500) » in the LogCat.

QBLocationRequestBuilder requestBuilder = new QBLocationRequestBuilder();

requestBuilder.setCurrentPosition(48.85837, 2.294481);
requestBuilder.setSort(SortField.DISTANCE, SortOrder.ASCENDING);
requestBuilder.setPerPage(Const.NB_USERS_PAGE);
requestBuilder.setLastOnly();

try {
    ArrayList<QBLocation> list = QBLocations.getLocations(requestBuilder, new Bundle());
} catch (QBResponseException e) {
    Log.e("QB debug", e.getMessage());
}

However, when I comment the setCurrentPosition() and setSort() methods, everything is alright. This is the URL called :

https://api.quickblox.com/geodata/find.json?current_position=48.85837%3B2.294481&sort_by=distance&sort_asc=1&per_page=10&page=1&last_only=1

Error while fetching the content blob

HI ,

I was trying to update a profile pic ( avatar ) for the user .

fileId is checked and has value which is same as BLOBID in the web dashboard.
QBContent.downloadFileTask(fileId, new QBEntityCallback(){

        @Override
        public void onSuccess(InputStream inputStream, Bundle params) {
            byte[] content = params.getByteArray(com.quickblox.core.Consts.CONTENT_TAG);
            InputStream is = inputStream;
            avatarImgView.setImageBitmap(BitmapFactory.decodeStream(is));
            avatar_loadingPanel.setVisibility(View.GONE);
            changeAvatarBtn.setEnabled(true);
           // String contentFromFile = HelperUtils.getContentFromFile(inputStream);
           // Log.i("ShowUserActivity", "file downloaded: "+contentFromFile);
            Log.i("ShowUserActivity", "params: " + params);
        }

        @Override
        public void onSuccess() {

        }

        @Override
        public void onError(List<String> errors) {
            System.out.println("downloadFileIDError:" + errors.toString());
            //handleErrors(errors);
        }
    });

Response and Request Load :

=== REQUEST ==== a1e0f7d4-c728-409c-9465-3aff81674839 ===
REQUEST
GET https://api.quickblox.com/blobs/4b81737293db48ac92b1831fc7bfb37700.json
HEADERS
QuickBlox-REST-API-Version=0.1.1
QB-SDK=Android 2.0
QB-Token=4defd954a968bbb9dcc48dd5454313b49fe89001
PARAMETERS
INLINE
GET https://api.quickblox.com/blobs/4b81737293db48ac92b1831fc7bfb37700.json
12-16 01:48:22.779 10981-10981/technovibe.zone D/QBASDK﹕ *********************************************************
*** RESPONSE ** a1e0f7d4-c728-409c-9465-3aff81674839 ***
STATUS : 412
HEADERS
Access-Control-Allow-Origin=

Cache-Control=no-cache
Connection=keep-alive
Content-Type=application/json; charset=utf-8
Date=Mon, 15 Dec 2014 20:18:22 GMT
QB-Token-ExpirationDate=2014-12-15 22:18:12 UTC
QuickBlox-REST-API-Version=0.1.1
Server=nginx/1.0.15
Status=412 Precondition Failed
Transfer-Encoding=chunked
X-Rack-Cache=miss
X-Request-Id=5af28754be469a25c9f20265b8b7b2d0
X-Runtime=0.015035
X-UA-Compatible=IE=Edge,chrome=1
BODY
'{"errors":{"base":["The file you are trying to download has not been uploaded properly"]}}'

It was working previously . WIll you please let me know if something wrong ?

cannot find symbol class ProcessDataThread, CameraDataListener, openCamera();

When trying to implement OwnSurfaceView.class,

I get an error during build:

Error:(37, 13) error: cannot find symbol class ProcessDataThread
Error:(48, 13) error: cannot find symbol class CameraDataListener
Error:(69, 39) error: cannot find symbol class CameraDataListener
Error:(112, 9) error: cannot find symbol method openCamera()
Error:(114, 39) error: cannot find symbol class ProcessDataThread
Error:(124, 13) error: cannot find symbol method processCameraData(byte[],int,int)

My code is exactly like your code posted. I'm using the latest build of android studio.

Custom Object created not seen in the DashBoard( But the response payload shows as creation success)

Hi Team,

I came across a critical scenario today in which the CustomObject created is not updated in the Web Dashboard. It was working perfectly fine till yesterday.

The Scenario is to add Relational Custom Data like 2 Custom Objects "Meetup" and "MeetupMember" .
Once the Parent Object is created the ID is supplied to the Child object as a parentid which was working till yesterday but not from today.
The first Table gets created (parent Custom Object ) but the Subsequent child object is not seen as created.
But the more worrying factor is that the Callback shows as success and the Rest API Response too shows success.

Update:

This bug is occurring only on multiple records insert only . Single Insertions are working. But previously multiple inserts also was working for me.

The API payloads are posted below for reference : ( 2 records to be inserted )

12-04 22:50:05.616 28625-28625/technovibe.zone D/QBASDK﹕ =========================================================
=== REQUEST ==== 26df5159-e11d-4ac4-9321-8b213e4cffd4 ===
REQUEST
POST https://api.quickblox.com/data/MeetupMember/multi.json
HEADERS
QuickBlox-REST-API-Version=0.1.1
QB-SDK=Android 2.0
QB-Token=6ae7725776d90d8c05ffbd2dsddsdds
PARAMETERS
record[1][_parent_id]=548097c5535c127cddd01a94
record[1][IsAdmin]=false
record[1][Mobile]=+919237299590
record[1][Name]=Unni Blr
record[1][MemberID]=1633279
record[2][_parent_id]=548097c5535c127cddd01a94
record[2][IsAdmin]=true
record[2][Mobile]=+918593822891
record[2][Name]=
record[2][MemberID]=1530339
INLINE
POST https://api.quickblox.com/data/MeetupMember/multi.json?record[1][_parent_id]=548097c5535c127cddd01a94&record[1][IsAdmin]=false&record[1][Mobile]=%2B919237299590&record[1][Name]=Unni+Blr&record[1][MemberID]=1633279&record[2][_parent_id]=548097c5535c127cddd01a94&record[2][IsAdmin]=true&record[2][Mobile]=%2B918593822891&record[2][Name]=&record[2][MemberID]=1530339
12-04 22:50:05.766 5356-5356/? I/wpa_supplicant﹕ Scan requested (ret=0) - scan timeout 30 seconds
12-04 22:50:05.776 427-443/? E/Sensors﹕ requested_sensors(3ff) from kernel
12-04 22:50:07.277 28625-28625/technovibe.zone D/QBASDK﹕ *********************************************************
*** RESPONSE ** 26df5159-e11d-4ac4-9321-8b213e4cffd4 ***
STATUS : 201
HEADERS
Access-Control-Allow-Origin=

Cache-Control=max-age=0, private, must-revalidate
Connection=keep-alive
Content-Type=application/json; charset=utf-8
Date=Thu, 04 Dec 2014 17:20:07 GMT
ETag="9c169f60aeec4f29d2f7500dc45d02d9"
QB-Token-ExpirationDate=2014-12-04 19:20:02 UTC
QuickBlox-REST-API-Version=0.1.1
Server=nginx/1.0.15
Status=201 Created
Transfer-Encoding=chunked
X-Rack-Cache=invalidate, pass
X-Request-Id=ab77b966b9d8ff6a38a2dcc5c98fc438
X-Runtime=0.019692
X-UA-Compatible=IE=Edge,chrome=1
BODY
'{"class_name":"MeetupMember","items":[]}'

Please check and let me know

thanks

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.