Hi,

In this update I added some assistance classes related with inter-application messaging in Android to JavocSoft Android Toolbox.JavocSoft Android Toolbox Library

Sometimes an application needs to accept messages from other applications, in those cases, a Messenger service must be implemented. See Messenger for more information about messaging. So, to make easier having a messenger service in an application, i have added a base MessengerService.java class to the library. Click here to access to the Messenger Service Wiki.

Here can be seen full example of how to have a valid Messenger Service in your application:

First, create the message incoming handler:

public class MyMessengerIncomingHandler extends MessengerIncomingHandler {

    //Messenger WHAT possible values
    public static final int MSG_EVT_HI = 1000;

    public MyMessengerIncomingHandler(Context context) {
        super(context);
    }

    @Override
    protected void doWork(Message msg) {
        switch (msg.what) {
            case MSG_EVT_HI:
                Log.i(Constants.TAG, "Messenger received: Hi!!");
                break;
            default:
                super.handleMessage(msg);
        }
    }
}

Second, the Messenger Service:

 public class MyMessengerService extends MessengerService {

 @Override
 protected MessengerIncomingHandler getMessageIncomingHandler() {
    return new MyMessengerIncomingHandler(context);
 }

}

And finally, in our AndroidManifest.xml:

<!-- Application messenger -->
<service android:name="es.javocsoft.base.genapp.service.MyMessengerService" 
	 android:enabled="true" android:exported="true" >
   <intent-filter>             
	<action android:name="es.javocsoft.base.genapp.messenger.ACTION_BIND" />
   </intent-filter>
</service>

Because we could need also to connect and send messages to other applications messenger services, I also added a class Mezzenger.java. Click here to access to the Messenger Wiki.

 

Mezzenger messenger = new Mezzenger("Inner", getApplicationContext()); 
messenger.connect("application.package.service.ACTION"); 
messenger.sendMessage(MSG_EVT_HI, 0, 0, null);

 

Do not forget to check the blog to get more updates!

More info and HowTo at https://github.com/javocsoft/javocsoft-toolbox/wiki.

github_icon

As always, library is available on GitHub

javocsoft-toolbox.

Bye.

JavocSoft 2015.

Hi all,

Today a new version of the library JavocSoft Android Toolbox have been released, in this case with a new module that integrates the Google Drive API. This allows to use Android ToolBox - Google DriveGoogle Drive within your applications in a really easy way. I wanted to add this to the library long time ago but until a few weeks i could not start doing it.JavocSoft Android Toolbox Library

To know how to use it and more  goto https://github.com/javocsoft/javocsoft-toolbox/wiki#google-drive.

As a brief, the list of operations that the new module for Google Drive allows are:

  • Create a file (with the posibility of creating it in the secure application folder).
  • Search for files.
  • Get a file given its name or title
  • Get the file contents.
  • Pin a file (this makes Google Drive to store a copy of its metadata locally in the Device).
  • Trash/Un-trash a file.
  • Be notified when a file changes (see TBDrive#addFileChangeListener() and TBChangeListener.java)
  • Subscribe to file changes (notifications are received even if the application is not running. See TBDrive#subscribeToFile() and TBDriveEventService.java).
  • Commit/Discard changes to a file (also be notified when Google Drive servers finish applying changes, see TBDriveEventService.java)
  • Get file contents as an String.
  • Append/Replace text to a file.
  • Get a DriveFile object from an encoded DriveId string.

As always, I hope these addition could be useful for your applications.

Do not forget to check the blog to get more updates!

More info and HowTo at https://github.com/javocsoft/javocsoft-toolbox/wiki.

github_icon

As always, library is available on GitHub

javocsoft-toolbox.

Bye.

JavocSoft 2015.

Hi all,

I am still finishing the Maps integration and other things to the JavocSoft Android Toolbox Library while preparing some documentation related to GCM and a few HowTos (you can read anyway the Wiki on GitHub) but meanwhile, i have added some useful animation methods that i would JavocSoft Android Toolbox Librarylike to share :).

The new stuff is:

  • Apply animations from one activity to another by using: animation_applyAnimationToActivityLoad().
  • Apply animations to a View by using new methods animation_getFromAnimResourceId() and animation_applyAnimationTo().
  • A set of predefined animations ready to use in your projects. Complete list:
    • Blinking: blink
    • Zooming: zoom_in.xml, zoom_out.xml, zoom_out_in.xml.
    • Curtain: curtain_up.xml , curtain_down.xml, curtain_down_and_bounce.xml, curtain_left_and_right.xml, curtain_right_and_left.xml,
    • Fade: fadein.xml, fadeout.xml,
    • Directions: left_in, left_out, right_in, right_out.
    • Pushing: push_down_in, push_down_out,
    • Rotate: rotate_left_and_right.xml, rotate_right_and_left.xml, rotate_left.xml, rotate_right.xml,
    • Sliding: slide_out.xml, slide_up.xml,
    • Others: bottom_in, move.

 

As always, I hope these changes could help you a bit more than before.

Do not forget to check the blog to get the Maps integration update!

More info and HowTo at https://github.com/javocsoft/javocsoft-toolbox/wiki.

github_icon

As always, library is available on GitHub

javocsoft-toolbox.

Bye.

JavocSoft 2015.

 

Hi all,

Finally i have finished with the last changes in JavocSoft Android Toolbox Library and it is ready on the GitHub repository!. As a brief:

  • There is more functionallity through a lot of new methods.
  • Notifications have been updated to last Android code 5.0+. NotificationCompat is used so now, all posibilities of a notification are implemented (actions, progress bar, priority, visibility and more).
  • GCM Module is updated with the new notifications posibilities allowing to customize more the notifications.

I am still preparing Google Maps v2 integration to put a map in your application with a few lines of code, i hope i can put more time in this to finish it.

JavocSoft Android Toolbox Library

I put here the detailed changes:

  • ToolBox, Notifications:
    • Finally, migrated to NotificationCompat builder 🙂
    • Now the notification title, ticker, content info and large icon can be customized.
    • Priority and visibility implemented, for Android 5.0+ API Level 21+.
    • Implemented big style expandable notification for Android 4.1+ (API Level 16+).
    • Implemented notification actions for Android 4.1+ (API Level 16+).
    • Implemented, for Android 4.0 API Level 14+, notification progress bar (determinate & indeterminate).
    • A new class ToolBox.NotificationProgressBarRunnable has to be extended to create your own long term process.
    • Implemented RemoteViews in notifications.
    • Method notification_generate is maintained for backwards compatibility (it uses also NotificationCompat).
    • New method notification_create that allow to customize completely a notification.
  • ToolBox, Added some more utility methods:
    • device_getOSCodename
    • device_getExtraInfo
    • application_packageName
    • application_packageInfo
    • application_nameInfo
    • application_certificates
    • random_HASH
    • random_UUID
    • random_getRandom
    • random_getSecureRandom
    • gson_linkedMapAsList
    • storage_readRawResource
    • storage_readAssetResource
    • media_getDrawableFromRaw
    • media_getBitmapFromResourceId
    • media_getBitmapFromAsset
    • media_getBitmapFromRaw
    • media_getBitmap (looks, in order, for the resource in Drawable -> Assets -> Raw -> URL)
    • Some media methods to get bytes from a resource image.
  • GCM Module now supports:
    • All ToolBox notification changes. Note: Priority is set to DEFAULT and visibility to PRIVATE.
    • Customization parameters (all these parameters should be set in the data object when delivering the notification to
      the devices in GCM) are:

      • notificationId
      • notStyle
      • title
      • message
      • ticker
      • contentInfo
      • bsTitle
      • bsContent
      • bsSummary
      • bsImage
      • bsInboxStyleContent
      • bsInboxStyleLineSeparator
      • bslargeIcon
  • Added a new TextView component (widget) that allows to show HTML tags.
  • Added a JSON Gson proccesor instance. It gives you a singleton with pre-configured gson processor for a normal process, and, if desired, the possibility of use an excluding “transient” attribute JSON processor and also one excluding properties without the Exposed annotation.
  • Added official PRNG Fix class to Android with API level minor or equal to 18 (Jelly Bean) for JCA or OpenSSL PRNG.
  • BUGFIX. In some devices (depending also of Android version) the flip effect runs laggy. Added a a new flipTransition method that allows to specify to check if the current device is one of reported laggy devices (like LG G3 or Nexus 5). In case is a laggy device, depending of the parameter “enableFadeForLaggyDevices” a fade effect is used as animation instead the desired flip or no effect is applied if set to FALSE.
  • BUGFIX. crypto_getHASH() function. Hash was not correctly generated.
  • BUGFIX. Fixed a bug that made the recived text not be showed correctly if character encoding was not latin.
  • BUGFIX. GCM. Fixed an issue with the event of Notification received. No context was returned. This could make an application to crash if used.
  • BUGFIX. Toolbox. Fixed device_getOSversion. Returned info was wrong.

As i said, these are a lot of changes because i have been implementing all notifications related stuff and quite busy at work so i could not publish until today. I think now the libreruy is more useful. I now that i still have to improve some points but i am already in it so have patiente.

As always, I hope these changes could help you a bit more than before.

 

Do not forget to check the blog to get the Maps integration update!

More info and HowTo at https://github.com/javocsoft/javocsoft-toolbox/wiki.

github_icon

As always, library is available on GitHub

javocsoft-toolbox.

Bye.

JavocSoft 2015.

Hi all,

There are changes in JavocSoft Android Toolbox Library ready on the GitHub repository!. There is a bit more functionallity to it and, i am preparing Google Maps v2 integration to put a map in your application with a few lines of code, i hope i finish this soon.

JavocSoft Android Toolbox Library

The changes are:

  • Added method to show GPS settings panel, “dialog_showGPSDisabledAlert()”
  • Added DENSITY_XXXHIGH to device_getResolutionType() or unknown if not recognized.
  • Added the method location_addressInfo() to get some latitude and longitude address information.
  • Now the method “dialog_showExitConformationDialog()” allows to select if move the activity to the stack or close it.
  • Added a method “backPressedAction()” to enable the functionallity of “Press again back to exit”.
  • Added AnimationFactory class, under animation package, from Ephraim Tekle, to perform animations in a easy way. I use it and i think is quite useful.
  • Added an ImageDownloader class, under net/image package, to download image URLs in background and show them in its ImageView.
  • Added the possibility of custom Toast messages, “toast_createCustomToast()”, default ones are horrible XD.
  • Added the possibility of a custom Toast when user press the back button to exit if function backPressedAction() is used.
  • Added the method location_distance to know the distance in meters from one Map point to other using the Haversine algorithm.
  • The “dialog_showToastAlert()” method now allows to choose between system default toast and a custom one.
  • Now the method “share_newSharingIntent()” allows to filter applications using more than one application filter.
  • On Interstitial Ad now user clicks on it can be cached.

I hope these changes can help you a bit more.

Do not forget to check the blog to get the Maps integration update!

 

More info and HowTo at https://github.com/javocsoft/javocsoft-toolbox/wiki.

github_icon

As always, library is available on GitHub

javocsoft-toolbox.

 

Bye.

JavocSoft 2015.

Hi all,

There is a new JavocSoft Android Toolbox Library ready on the GitHub repository!. It has taken
quite long to get finally an updated and tested version but now is ready again. This version comes with some interesting updates like:

JavocSoft Android Toolbox Library

  • Google Play Services integration for Google Cloud Messaging (GCM), AdMob and
    Analytics
    (the GCM module has been rebuilt, maintaining the previous usage with some minor changes in usage).
  • CMTInfoHelper. This class allows to download automatically the CMT official short-numbers information. This will give you the possibility of knowing the owner company of a given short-number.
  • Facebook Login and Share fragments to easily integrate Facebook options into an application.
  • Google Analytics Campaign Measurement integration.
  • More utility methods to the Toolbox class.

With this update all implemented Google Play Services are very easy to set-up into your app. Give it a try to:

  • Improve your application by adding GCM, AdMob or Analytics functionalities.
  • Simplify your application code by using the utility methods of the Toolbox class.

More info and HowTo at https://github.com/javocsoft/javocsoft-toolbox/wiki.

github_icon

As always, library is available on GitHub

javocsoft-toolbox.

 

Bye.

JavocSoft 2014.