iCometClient4j


Source link: https://github.com/kyleduo/iCometClient4j

iCometClient4j

Client of iComet server for Java/Android. iComet server: https://github.com/ideawu/icomet

This project is based the iComet service which can be found in https://github.com/ideawu/icomet created by ideawu( www.ideawu.com).

Simply, this project is an implements of client for iComet service. You can use it in your java project as well as Android project.

If you want to know what the effect of this client is look at, there's an demo in Java prepared for running in none auth mode. Obviously, you need an iComet server. Mine is run on my mac under default configuration.

Demo

There are two demos in this project for Java android Android.

The one for Android is based on the one for Java by using the release jar file. You can find it in https://github.com/ideawu/icomet-demos , where you can also find a updated website demo.

AndroidDemo can be your reference in your own project, but it is suggested that you should implement the logic yourself to match your own business. If there are bugs, please mail me.

Usage

Here's some decription of how to use this client.

Using getInstance() method to get an instance of ICometClient.

Before you connet to the iComet server, you should make the client prepared with the ICometConf object by calling prepare(ICometConf) method. The ICometConf object should be completely initialed with those params which you can find under.

mClient = ICometClient.getInstance();
  ICometConf conf = new ICometConf();
 conf.host = "127.0.0.1"; conf.port = "8100"; conf.url = "stream"; conf.iConnCallback = new MyConnCallback();
 conf.iCometCallback = new MyCometCallback();
 conf.channelAllocator = new NoneAuthChannelAllocator();
  mClient.prepare(conf);
 

As you can see, there are one ChannelAllocator and two Callbacks for your business.

The ChannelAllocator is used to connect to your own server and request a channel for connetiong to iComet server and a token for authorization if you need it. Also, seq is configurated in this allocator, such that you can decide whether to fetch some old message of that channel. There is only one method in this interface for now:

allocate();
 

As their names say, the two Callbacks is used for connection and fetching process separately. It is important that you should always implement these two interface and put them into ICometConf object. Following by a outline of these two Callbacks:

IConnCallback {

public void onFail(String msg);

public void onSuccess();

public void onDisconnect();

public void onStop();

public boolean onReconnect(int times);

public void onReconnectSuccess(int times);
 
}
  ICometCallback {

public void onDataMsgArrived(Message.Content content);

public void onMsgArrived(Message msg);

public void onErrorMsgArrived(Message msg);

 public void onMsgFormatError();
 
}
 

When the client is ready, just a invoke of connect() method will connect it to iComet server. If you use this client in an Android project, you should invoke this method in an children thread, otherwise you would get a NetworkOnMainThreadException.

Then the IConnCallback will be invoked, if there's nothing wrong, you can use comet() method to listen the connection and you will receive the messages from iCometServer which you can deal with them by ICometCallback.

There's something else to know about the ICometCallback, the onMsgArrived() method will be invoked when any message arrive while onDataMsgArrived() and onErrorMsgArrived() will be invoked on for arriving of specific message related to their name.

Much more information will be in wiki and docs pages soon.

Have fun with it!

Resources

android-ripple-background is a beautiful ripple animation for your app. You can easily change its color, speed of wave, one ripple or multiple ripples.

This is fully-fledged the native BOINC client for Android and BOINC Manager (based on AndroBOINC) especially designed for working with this version of BOINC client.

Official Website

RapidJSON is a JSON parser and generator for C++. It was inspired by RapidXml.

Features:

  • Small but complete. It supports both SAX and DOM style API.
  • Fast. Its performance can be comparable to strlen().
  • Self-contained. It does not depend on external libraries.
  • Memory friendly. Each JSON value occupies exactly 16/20 bytes.
  • Unicode friendly.

EdgeEffectOverride is library designed to help override the blue overscroll_edge and overscroll_glow effects used by the the EdgeEffect class.

Simply import the project into your library, replace existing references to ScrollView, ListView, ExpandableListView, GridView & ViewPager with references to the the classes found in this library.

No need to edit any graphics, simply colorize the edge effect dynamically or via the layout xml, easy!

A Reactive wrapper around Google's YouTube Data API.

material-dialogs library allows you to use a consistently Material themed dialog on all versions of Android, along with specific customizations that make it easier to brand the dialog.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes