Вопрос

I am using Scringo for implementing Group Chat within my Android App. Is there a way in which we can open a particular chatroom through code ? Right now, from the sample applications and API, I found only the below code.

Scringo.openChatRooms(MainActivity.this);

Please let me know how do I

  1. Create a Chatroom programmatically
  2. Open a particular Chatroom programmatically.
Это было полезно?

Решение

Right now Scringo SDK is not providing way to open a chatroom programmatically. They are having their own screens(Activity) to manage the many to many Chat functionality. They are yet to integrate the following features on their Android SDK. 1. Creating Chatrooms programmatically 2. Joining/Opening Chatrooms programmatically

Source: I got a response from their Support Team. They claim that this feature is available for their IOS sdk. I am not sure.

Другие советы

This code solved my problem :

MainActivity.java

public class MainActivity extends Activity {

private Scringo scringo;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    scringo = new Scringo(this);

    ...

    findViewById(R.id.openChatRoomButton).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View arg0) {
            Scringo.openChatRooms(MainActivity.this);
        }
    });

    ...

}

main.xml

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >

    ...

    <Button
        android:id="@+id/openChatRoomButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clickable="true"
        android:text="@string/open_inbox_button_text" />

</RelativeLayout>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top