This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2008 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { | |
inflater.inflate(R.menu.fragment_chatlist, menu); | |
} | |
@Override | |
public void onPrepareOptionsMenu(Menu menu) { | |
super.onPrepareOptionsMenu(menu); | |
inboxMenuItem = menu.findItem(R.id.menu_search); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
### ejabberd configuration file | |
### | |
### | |
### The parameters used in this configuration file are explained in more detail | |
### in the ejabberd Installation and Operation Guide. | |
### Please consult the Guide in case of doubts, it is included with | |
### your copy of ejabberd, and is also available online at | |
### http://www.process-one.net/en/ejabberd/docs/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Pull this file down, make it executable and run it with sudo | |
# wget https://gist.githubusercontent.com/bryanhunter/10380945/raw/build-erlang-17.0.sh | |
# chmod u+x build-erlang-17.0.sh | |
# sudo ./build-erlang-17.0.sh | |
if [ $(id -u) != "0" ]; then | |
echo "You must be the superuser to run this script" >&2 | |
exit 1 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* The code is taken from ProjectMaxs. For details please look - https://github.com/ProjectMAXS/maxs/blob/73043374fa4ec0ce0d881bb8d42a241ef80fa9eb/transport-xmpp/src/org/projectmaxs/transport/xmpp/xmppservice/XMPPService.java | |
*/ | |
final Roster roster = Roster.getInstanceFor(connection); | |
// Setup the roster store | |
File rosterStoreDirectory = FileUtil.getFileDir(mContext, "rosterStore"); | |
RosterStore rosterStore = DirectoryRosterStore.init(rosterStoreDirectory); | |
roster.setRosterStore(rosterStore); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* The code is taken from ProjectMaxs. For details please look - https://github.com/ProjectMAXS/maxs/blob/73043374fa4ec0ce0d881bb8d42a241ef80fa9eb/transport-xmpp/src/org/projectmaxs/transport/xmpp/xmppservice/XMPPService.java | |
*/ | |
xmppConnection.addStanzaAcknowledgedListener(new StanzaListener() { | |
@Override | |
public void processPacket(Stanza packet) throws SmackException.NotConnectedException, InterruptedException { | |
removePacket(packet.getStanzaId()); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ApplicationLifeCycleHandler implements Application.ActivityLifecycleCallbacks { | |
// Using the approach defined here - http://steveliles.github.io/is_my_android_app_currently_foreground_or_background.html | |
public interface Listener { | |
public void onBecameForeground(); | |
public void onBecameBackground(); | |
} | |
public class ClienStateIndicationListener implements Listener { | |
XMPPConnection xmppConnection; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.text.TextUtils; | |
import io.realm.Case; | |
import io.realm.Realm; | |
import io.realm.RealmObject; | |
import io.realm.RealmResults; | |
public class RealmFullTextSearch { | |
public static <T extends RealmObject> RealmResults<T> search(Realm realm, Class<T> modelClass, String query, String fieldName, boolean partialSearch){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rx.Subscriber; | |
/** | |
* Created by harshitbangar on 19/08/16. | |
*/ | |
public class MainClass { | |
public static void main(String[] args) { | |
QueueLibraryManager queueLibraryManager = new QueueLibraryManager(); | |
queueLibraryManager.addToQueue("arbit").subscribe(new TestSubscriber()); |
OlderNewer