Android Open Source - location-sharing-android Utils






From Project

Back to project page location-sharing-android.

License

The source code is released under:

MIT License

If you think the Android project location-sharing-android 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

package lv.lu.locationsharing.utils;
/*from   w  w  w .  ja  v  a  2s .co  m*/
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;

@SuppressLint("DefaultLocale")
public final class Utils {

  static final String DISPLAY_MESSAGE_ACTION = "com.mynfcteam.natuplan.DISPLAY_MESSAGE";

  static final String EXTRA_MESSAGE = "message";

  /**
   * Notifies UI to display a message.
   * <p>
   * This method is defined in the common helper because it's used both by the
   * UI and the background service.
   * 
   * @param context
   *            application's context.
   * @param message
   *            message to be displayed.
   */
  public static void displayMessage(Context context, String message) {
    Intent intent = new Intent(DISPLAY_MESSAGE_ACTION);
    intent.putExtra(EXTRA_MESSAGE, message);
    context.sendBroadcast(intent);
  }

  public static String bytesToHex(byte[] byteArray) {
    StringBuilder stringBuilder = new StringBuilder();
    for (int i = 0; i < byteArray.length; i++) {
      stringBuilder.append(Integer
          .toString((byteArray[i] & 0xff) + 0x100, 16).substring(1)
          .toUpperCase());
    }
    return stringBuilder.toString();
  }
}




Java Source Code List

lv.lu.locationsharing.Fragment1.java
lv.lu.locationsharing.Fragment2.java
lv.lu.locationsharing.Fragment3.java
lv.lu.locationsharing.Fragment4.java
lv.lu.locationsharing.Fragment5.java
lv.lu.locationsharing.LocationBroadcastReceiver.java
lv.lu.locationsharing.LoginActivity.java
lv.lu.locationsharing.MainActivity.java
lv.lu.locationsharing.MenuListAdapter.java
lv.lu.locationsharing.SignUpActivity.java
lv.lu.locationsharing.application.LocationApplication.java
lv.lu.locationsharing.config.Config.java
lv.lu.locationsharing.listview.adapter.RequestAdapter.java
lv.lu.locationsharing.model.AuthenticationStatus.java
lv.lu.locationsharing.model.Friend.java
lv.lu.locationsharing.model.GetFriends.java
lv.lu.locationsharing.model.InviteFriends.java
lv.lu.locationsharing.model.LocationPostStatus.java
lv.lu.locationsharing.model.Registration.java
lv.lu.locationsharing.requests.authentication.AuthenticationRequest.java
lv.lu.locationsharing.requests.authentication.AuthenticationStatusRequest.java
lv.lu.locationsharing.requests.friends.ConfirmFriendRequest.java
lv.lu.locationsharing.requests.friends.GetFriendsRequest.java
lv.lu.locationsharing.requests.friends.InviteFriendsRequest.java
lv.lu.locationsharing.requests.friends.PostLogout.java
lv.lu.locationsharing.requests.location.PostLocationUpdate.java
lv.lu.locationsharing.requests.registration.RegistrationRequest.java
lv.lu.locationsharing.utils.Constants.java
lv.lu.locationsharing.utils.Installation.java
lv.lu.locationsharing.utils.Url.java
lv.lu.locationsharing.utils.Utils.java