Hola,

En el día a día, como desarrolladores, vamos usando una serie de tecnologías sin prestarle mucha atención normalmente a de donde vienen o que significa el nombre de cada tecnología o framwork. La verdad es que en ocasiones a uno le parece curioso alguno pero nunca acabamos investigando para saciar nuestra curiosidad.

Hace poco que me dió por ver de donde venía el nombre de “Apache”, sentía curiosidad y me sorprendió mucho, encontré varios artículos al respecto y me dió por mirar las páginas web de algunas tecnologías. Al final acabé pasando un buen rato 🙂

 

Os dejo con algunos ejemplos curiosos:

Apache

En este caso, según su web http://www.apache.org/foundation/faq.html#name, parece que el nombre le vino por respeto a las tribus nativas de indios americanos, estos eran conocidos por su dureza y por ser buenos estrategas en la batalla, el equipo de desarrollo finalmente se empezó a llamar a sí mismos como el “Apache Group” 🙂

 

Android

El sistema operativo móvil más usado mundialmente. En este caso muchos sabemos que las versiones de este SO vienen de nombres de dulces. Su nombre, “Android”, aunque evidente, en el contexto de la ciencia ficción, viene de un robot con apariencia humana 🙂

 

Git

Si, el famoso sistema de control de versiones creado por Linus Torvalds, el creador de Linux. En este caso, fué un nombre que le dió en representación de sí mismo XDD. Parece que GIT en inglés británico slang significa algo así como “Estúpido  o persona desagradable” mientras que en irlandés slang significa “bastardo”. Torvalds dijo: “I’m an egotistical bastard, and I name all my projects after myself. First ‘Linux’, now ‘git’“. ver https://en.wikipedia.org/wiki/Git_(software)#History. De hecho, si vais a la página de Man del Git, https://www.kernel.org/pub/software/scm/git/docs/git.html, veréis la descripción de Git: “The stupid content tracker” XDD

 

Camel

En el caso de este motor de ruteo, viene de que esta tecnología puede sobrevivir sin la carga de pesados XML de configuración al igual que un camello puede sobrevivir largas distancias sin agua. También parece que porque parte de su equipo fumaba cigarrillos Camel XDD. Podeis ver más información en la propia página de Camel http://camel.apache.org/why-the-name-camel.html.

 

Tomcat

En este caso, parece que su creador quería un nombre que diera a entender que el propio servidor de aplicaciones podía valerse por si mismo sin depender de nada más. Así que por eso le llamó “gato” porque al igual que un gato, este es muy independiente y se vale por si mismo XDD. Más info https://en.wikipedia.org/wiki/Apache_Tomcat#History. Me encantan los gatos por cierto.

 

Si os pica mas la curiosidad podéis buscar otros y si os hace, compartirlos como comentarios para el disfrute de todos 🙂

 

 

Un saludo y feliz estreno de Star Wars!,

Hi all,

JavocSoft Android Toolbox Library

After a few weeks i have acumulated changes that fix a few things and improve a bit the library JavocSoft Android Toolbox. From now i will wait until i have enough changes before upgrading it. In this update there are changes related to location service, SQLite module and fixes to the ToolBox itsef. Below the list of changes:

  • ToolBox:
    • Lately I have been using notification button actions in some applications and  I realized that the method I had for it it wasn’t very good because I still had to code a bit. Because of this, I created a new method “notification_createActionButton()”. Now you only need to pass some arguments and do not need to code nothing to get the action. Remenber that notification buttons are available since Android 4.1+ (compatibility classes are used anyway). Now is really very easy to create notification action buttons 🙂
    • If you get in an application this message in the logcat:
      Choreographer(abc): Skipped xx frames! The application may be doing too much work on its main thread.
      You have a problem that need to be solved because it can be a perfomance problem in your app, you may be doing to much work in the main application UI thread.
      To help solving it, there is a new method “” that enables Android StrictMode warning logs and appropiate actions so you can locate the source code responsible of the bad perfomance.
    • There is also a new method “threadIsMainApplicationUIThread()” that returns TRUE if the current thread is the main application UI thread.
  • SQLite:
    • DBHelper. Added update methods “updateWhere()”.
    • SQLite. Fixed a bug in DBSQLite in the method “onUpgrade()”. The bug made updates to do not be done.
  • Location Service:
    • Now logs only are printed if the debug mode is ON.
    • Now location updates are discarded if is the same location or if the distance between location (appbox amazonapps using Haversine formula) is minor than the minimal distance threshold.

 

I hope this changes help you a bit more using JavocSoft Android Toolbox 🙂

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 again,

Today i have had time to isolate a class to have a localization service ready-to-use in the library JavocSoft Android Toolbox.

JavocSoft Android Toolbox LibraryThis will allow, very easily, to have an application that watches for any location change (or GPS enabled/disabled) event in background even if the application is not running because is an Android service 🙂

To use it, first declare in your AndroidManifest.xml:

<service android:name="es.javocsoft.android.lib.toolbox.location.service.LocationService" android:label="Location Service" android:enabled="true"/>

And launch it:

Intent mLocServiceIntent = new Intent(getBaseContext(), LocationService.class);
Bundle extras = new Bundle();
extras.putInt(LocationService.LOCATION_SERVICE_PARAM_MIN_DISTANCE, 2);
extras.putInt(LocationService.LOCATION_SERVICE_PARAM_MIN_TIME, 4000);
mLocServiceIntent.putExtras(extras);
startService(mLocServiceIntent);

And to stop it, when required:

Intent mLocServiceIntent = new Intent(getBaseContext(), LocationService.class);
stopService(mLocServiceIntent);

 

The localization service can also be customized when launched by setting in the service launching intent these parameters:

  • LocationService.LOCATION_SERVICE_PARAM_MIN_DISTANCE
  • LocationService.LOCATION_SERVICE_PARAM_MIN_TIME

Once is running, the service will broadcast the following events:

  • LOCATION_SERVICE_STARTED. Intent filter name:
    es.javocsoft.android.lib.toolbox.location.service.intent.action.LOCATION_SERVICE_STARTED
  • LOCATION_SERVICE_SHUTDOWN. Intent filter name:
    es.javocsoft.android.lib.toolbox.location.service.intent.action.LOCATION_SERVICE_SHUTDOWN
  • LOCATION_CHANGED. Intent filter name:
    es.javocsoft.android.lib.toolbox.location.service.intent.action.LOCATION_CHANGED
  • LOCATION_GPS_DISABLED. Intent filter name:
    es.javocsoft.android.lib.toolbox.location.service.intent.action.LOCATION_GPS_DISABLED
  • LOCATION_GPS_ENABLED. Intent filter name:
    es.javocsoft.android.lib.toolbox.location.service.intent.action.LOCATION_GPS_ENABLED

So now, to attend the localization events you only have to create a BroadcastReceiver:

public class LocationChangedReceiver extends WakefulBroadcastReceiver {
 
 protected static String TAG = "LocationChangedReceiver";
 
 
 public LocationChangedReceiver() {
 
 }
 @Override
 public void onReceive(Context context, Intent intent) {
 
   Bundle bundle = intent.getExtras(); 
   if(intent.getAction().equals(LocationService.ACTION_LOCATION_CHANGED)) { 
     //The Location Service leaves the detected location in the extras using
     //the key LocationService.LOCATION_KEY.
     Location location = bundle.getParcelable(LocationService.LOCATION_KEY);
     //Do something
   }else if(intent.getAction().equals(LocationService.ACTION_LOCATION_GPS_ENABLED)){
     //Do something
   }else if(intent.getAction().equals(LocationService.ACTION_LOCATION_GPS_DISABLED)){
     //Do something
   }else if(intent.getAction().equals(LocationService.ACTION_LOCATION_SERVICE_STARTED))
     //Do something 
   }else if(intent.getAction().equals(LocationService.ACTION_LOCATION_SERVICE_SHUTDOWN)){
     //Do something
   }
 }
}

And declare this receiver in your application AndroidManifest.xml:

<receiver android:name="your_application_package.LocationReceiver" android:enabled="true" android:exported="false"/>
 <intent-filter>
 <action android:name="es.javocsoft.android.lib.toolbox.location.service.intent.action.LOCATION_SERVICE_STARTED"/>
 <action android:name="es.javocsoft.android.lib.toolbox.location.service.intent.action.LOCATION_SERVICE_SHUTDOWN"/>
 <action android:name="es.javocsoft.android.lib.toolbox.location.service.intent.action.LOCATION_CHANGED"/>
 <action android:name="es.javocsoft.android.lib.toolbox.location.service.intent.action.LOCATION_GPS_ENABLED"/>
 <action android:name="es.javocsoft.android.lib.toolbox.location.service.intent.action.LOCATION_GPS_ENABLED"/>
 </intent-filter>
<receiver/>

 

I hope this addition make your life easier 🙂

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,

With new versions of Android, the library needs to be adapted to deal with new possibilities JavocSoft Android Toolbox Libraryand requirements. In this case, the new library JavocSoft Android Toolbox version has resources to handle new Android 6+ Permission system. This will allow us to embrace and adapt our applications to Android 6 new permissions usage approach.

Android 6 and Permissions

Beginning in Android 6.0 (API level 23), users grant permissions to apps while the app is running, not when they install the app. If the device is running Android 5.1 (API level 22) or lower, or the app’s targetSdkVersion is 22 or lower, the system asks the user to grant the permissions at install time.

System permissions are divided into two categories, normal and dangerous (more info):

  • Normal permissions do not directly risk the user’s privacy. If your app lists a normal permission in its manifest, the system grants the permission automatically. See the list here.
  • Dangerous permissions can give the app access to the user’s confidential data. If your app lists a normal permission in its manifest, the system grants the permission automatically. If you list a dangerous permission, the user has to explicitly give approval to your app. If an app requests a dangerous permission listed in its manifest, and the app already has another dangerous permission in the same permission group, the system immediately grants the permission without any interaction with the user.

See Google Developer Permissions to know more about it.

Adapt your application

To adapt an application to the new permissions usage approach of Android 6+, the application has to be able to deal with these use cases:

  • Start the App. Ask for permission (showing before a message telling why do you need before ask for them)
    • Accept. Ask for permissions:
      • Accept -> App runs normally with the service that requires the permissions.
      • Not accept -> App runs normally without the service that requires the permissions.
    • Cancel. App runs normally without the service that requires the permissions.
  • With previously granted permissions, start the App:
    • Start the App -> App runs normally with the service that requires the permissions.
  • In a running App with granted permissions:
    • Deny the permissions -> When returning to the App, it Asks for permissions (showing before a message telling why do you need before ask for them):
      • Accept. Ask for permissions:
        • Accept -> App runs normally with the service that requires the permissions.
        • Not accept -> App runs normally without the service that requires the permissions.
      • Cancel. App runs normally without the service that requires the permissions.
  • User denies the permission and marks “Never ask again”
    • Start the App:
      • Show a message to the user about the required permissions (showing before a message telling why do you need before ask for them)
        • Accept. Ask for permissions:
          • Accept -> App runs normally with the service that requires the permissions.
          • Not accept -> App runs normally without the service that requires the permissions.
        • Cancel. App runs normally without the service that requires the permissions.

For devices with Android minor than 6 version, API Level 23, you should be able to open the application normally and use it without prompting for any permission because they are already granted when the application is installed.

 

The library JavocSoft Android Toolbox gives you the method to achieve these point in a relative easy way.

Usage

ToolBox provides methods to check for permissions allowing us to present to the user an informative dialog and also ask to allow them if they are not already granted. ToolBox uses the Android Support Library for backward Android compatibility.

The list of functions to handle permissions are:

  • permission_askFor
  • permission_checkAskPermissionsresult
  • permission_isGranted
  • permission_areGranted

ToolBox also provides a set of permissions packages according with Google permissions group. This makes easy for you to ask for permissions for a service that requires a set of permissions.

  • PERMISSION_CALENDAR
  • PERMISSION_CAMERA
  • PERMISSION_LOCATION
  • PERMISSION_MICROPHONE
  • PERMISSION_PHONE
  • PERMISSION_SENSORS
  • PERMISSION_SMS
  • PERMISSION_STORAGE

Here is an example of usage. In this case we are going to use the localization service.

This service requires two permissions that are not automatically granted (not in Google NORMAL permissions group):

  • ACCESS_COARSE_LOCATION
  • ACCESS_FINE_LOCATION

ToolBox has these two permissions in the PERMISSION_LOCATION set. We will use this set to ask for permission to the user:

<!-- Before use it, we check if the permissions are already granted. -->
if(!ToolBox.permission_areGranted(TheActivity.this, ToolBox.PERMISSION_LOCATION.keySet())) {
    //Permissions not yet granted, we need to be ask.
    ToolBox.permission_askFor(TheActivity.this, ToolBox.PERMISSION_LOCATION,     
            ToolBox.PERMISSIONS_REQUEST_CODE_ASK_LOCATION, 
        getString(R.string.permissions_required_title), 
        getString(R.string.permissions_button_ok),
        getString(R.string.permissions_button_deny),
        getString(R.string.permissions_location_required_text));
}else{
     //Permissions are already granted, continue using the localization service...
 
}

To handle the permissions ask response, we must do the following:

<!-- This method handles the response -->
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
    permissionsLocationGranted = checkAskPermissionsresult(requestCode, permissions, grantResults);
    Log.i(Constants.TAG, "Location permissions granted? " + permissionsLocationGranted);
    super.onRequestPermissionsResult(requestCode, permissions, grantResults);
 
    if(permissionsLocationGranted) {
        //Continue with the usage of the service that needs the permissions...
 
    }else{
        //Do something if required...
    }        
}
 
private boolean checkAskPermissionsresult(int requestCode, String[] permissions, int[] grantResults) {
    boolean res = false;   
    if(requestCode == ToolBox.PERMISSIONS_REQUEST_CODE_ASK_LOCATION) {
            //We could check the permissions in our system
        //res = ToolBox.permission_areGranted(SplashActivity.this, Arrays.asList(permissions));         
            //We check the returned result. Only returns TRUE if all permissions are granted.
        res = ToolBox.permission_checkAskPermissionsresult(permissions, grantResults);
    }
    return res;
}

Have in mind that every time you use a service o function that requires permissions, you should check the current permissions by using:

ToolBox.permission_areGranted(TheActivity.this, ToolBox.PERMISSION_LOCATION.keySet());

To know more about it goto https://github.com/javocsoft/javocsoft-toolbox/wiki#android-6-permissions-handle.

 

Recommended videos about permissions in Android M that you should check:

 

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.

Hola,

Nos alegra comunicaros que ahora la mejor web para pasar el rato, WCTime Web (http://www.wctime.javocsoft.es), con imágenes, memes wctime_icony Gifs animados, ya permite crear una cuenta para por ejemplo, marcar imágenes como favoritos y así poder guardar las que más te gusten para compartirlas más tarde o coleccionarlas.

 

Iremos añadiendo poco a poco más cosas y más adelante, incluso subir tus propios memes e imágenes 🙂

Recordad que también tenéis el contenido vía aplicación en el store de Android, WCTime Play Store.

 

Espero la sigáis disfrutando y ya sabéis, si os gusta, dadle un Like 🙂 y/o descargad la app.

Un saludo,

Hola,

LLevábamos ya un tiempo pensando en disponer del contenido de la aplicación WCTime en la webwctime_icon para que cualquiera pudiera pasar un rato entretenido directamente, sin tener que bajar la aplicación.

Hoy esta por fín WCTime esta on-line en la web! Es una primera versión que irá evolucionando aún.

Teneis WCTime On-Line en http://www.wctime.javocsoft.es

 

Espero que os haga pasar buenos ratos y ya sabéis, si os gusta, dadle un Like y/o descargad la app.

Un saludo,