Android Open Source - BerryTube Berry Tube Callback






From Project

Back to project page BerryTube.

License

The source code is released under:

GNU General Public License

If you think the Android project BerryTube listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * BerryTube Service// www  .j  a  va 2 s .  c  o m
 * Copyright (C) 2012 Daniel Triendl <trellmor@trellmor.com>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.trellmor.berrytube;

/**
 * This interface allows the service to inform the application about status and
 * data changes. Applications that want to receive those callbacks must provide
 * an implementation of this interface.
 * 
 * To register a callback instance with the <code>BerryTube</code> service, use
 * <code>BerryTube.registerCallback(BerryTubeCallback)</code>
 * 
 * To remove a callback from the service use
 * <code>BerryTube.unregisterCallback(BerryTubeCallback)</code>
 * 
 * @author Daniel Triendl
 * 
 */
public interface BerryTubeCallback {
  /**
   * Server accepted the nick set
   * 
   * @param nick
   *            Nickname
   */
  void onSetNick(String nick);
  
  /**
   * Login failed
   * 
   * @param error ErrorMessage
   */
  void onLoginError(String error);

  /**
   * A new chat message was received
   * 
   * @param chatMsg
   *            The chat message
   */
  void onChatMessage(ChatMessage chatMsg);

  /**
   * The drink count for the current video has been changed
   * 
   * @param count
   *            New drink count
   */
  void onDrinkCount(int count);

  /**
   * A new poll was started
   * 
   * @param poll Poll object
   */
  void onNewPoll(Poll poll);

  /**
   * A poll has been updated
   * 
   * This happens when any users casts a vote
   * 
   * @param poll Poll object
   */
  void onUpatePoll(Poll poll);

  /**
   * The poll has been closed
   */
  void onClearPoll();
  
  /**
   * The currently playing video was updated
   * 
   * @param name The name of the video (e.g. Sh-Pony).
   * @param id The 11-character YouTube ID of the video (e.g. JWa0kkIRumk).
   */
  void onVideoUpdate(String name, String id, String type);

  /**
   * The user was kicked from the server
   */
  void onKicked();

  /**
   * The connection to the sever was lost
   */
  void onDisconnect();
}




Java Source Code List

com.trellmor.berrytube.BerryTubeBinder.java
com.trellmor.berrytube.BerryTubeCallback.java
com.trellmor.berrytube.BerryTubeIOCallback.java
com.trellmor.berrytube.BerryTube.java
com.trellmor.berrytube.ChatMessage.java
com.trellmor.berrytube.ChatUser.java
com.trellmor.berrytube.Poll.java
com.trellmor.berrytubechat.BerryTubeUtils.java
com.trellmor.berrytubechat.ChatActivity.java
com.trellmor.berrytubechat.ChatMessageAdapter.java
com.trellmor.berrytubechat.ChatMessageFormatter.java
com.trellmor.berrytubechat.FlairGetter.java
com.trellmor.berrytubechat.MainActivity.java
com.trellmor.berrytubechat.SettingsActivity.java
com.trellmor.berrytubechat.SettingsFragment.java
com.trellmor.berrytubechat.SimpleCrypto.java