quickblox / quickblox-android-sdk Goto Github PK
View Code? Open in Web Editor NEWQuickBlox Android SDK includes code snippets with main use cases and framework JAR library.
License: BSD 3-Clause "New" or "Revised" License
QuickBlox Android SDK includes code snippets with main use cases and framework JAR library.
License: BSD 3-Clause "New" or "Revised" License
QBVideoChatController.getInstance().finishVideoChat(videoChatConfig);
This is not ending the call when call is not accepted by the user.
After the user accept the call the above code is working fine.
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
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 ?
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.
Hi Team ,
I was not able to figure out on how we should create a GeoData with Location Push who are already in any GeoFence. Was not able to find the appropriate class to be used in Android API . ALreadt, found the same for IOS API ( http://quickblox.com/developers/Location#Create_geodata ) . Please help me out on how to do the same in Android API.
Thanks ,
Jobin
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
I develop a chat application on 1.2.4 lib , but it doesnot communicate with iOS latest quickblox version, but in case of android it works. Would we need to upgrade this to 2.0 beta version? but this version has no such documentation.
Please help me to resolve this problem.
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 :-)
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 .
Please help me regarding this problem. I have suffered from a long time, if its not happen realy then I would upgrade android lib from 1.2.4 to 2.0 Beta .
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"]}'
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.
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.
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
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
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-
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.
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 ,
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.
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?
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?
In whatsapp a particular user can create maximum number of group/public_group. So, like whatsapp , is quickblox has any limitation? If yes, then how much. Can increase or decrease the limitation ? Please help me in this question.
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.
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.
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 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);
}
});
}
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
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) {
}
});
}
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!
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
Hi ,
I am getting messages when i am in chat dialog , How can i get incoming messages from any user in case of whenever i am in the application ,
I would like to notify app user that you have received a new message .
Please let me know
Hey QuickBlox team,
I really like your service. I have it working for iOS but I'm having a lot of trouble getting the android version working.
I can connect, but I can't send or receive video from my partner.
I'll also posted the question here http://stackoverflow.com/questions/26188744/cant-get-video-working-for-new-android-sdk-of-quickblox
Thanks again for all your hard work!
I have class core.java with all the XMPP methods and connection.
I want to create one object from core.java.
I have class menuFragment.java which handle with FragmentA,FragmentB,FragmentC.
Is it possible to create new core object and pass it alive with all the refrence methods
To FragmentA,FragmentB,FragmentC?
无语。。。。
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();
}
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
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
I would like to make group chat which have the following features:
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.
There are no setters on the new QBChatMessage object for SenderId and RecipientId. How do I set the senderId and Recipient on a QBChatMessage
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");
}
}
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
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 .
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());
}
});
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
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).
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.
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 ?
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?
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).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.