domingo, 14 de octubre de 2012

New Social APIs in Android ICS

[This post is by Daniel Lehmann, Tech Lead on the Android Apps team. — Tim Bray]

[We're trying something new; There's a post over on Google+ where we'll host a discussion of this article. Daniel Lehmann has agreed to drop by and participate. Come on over and join in!]

With Android Ice Cream Sandwich, we set out to build software that supports emotional connections between humans and the devices they carry. We wanted to build the most personal device that the user has ever owned.

The first ingredient in our recipe is to show users the people that they care about most in a magazine-like way. High-resolution photos replace simple lists of text.

The second ingredient is to more prominently visualize their friends' activities. We show updates from multiple sources wherever a contact is displayed, without the need to open each social networking app individually.

Android is an open platform, and in Ice Cream Sandwich we provide a rich new API to allow any social networking application to integrate with the system. This post explains how apps like Google+ use these APIs, and how other social networks can do the same.

A few basics

Since Eclair (Android 2.0), the system has been able to join contacts from different sources. Android can notice if you are connected to the same person and different networks, and join those into aggregate contacts.

Essential terms to understand throughout the remainder of this post are:

  • RawContact is a contact as it exists in one source, for example a friend in Skype.

  • Data rows exists for each piece of information that the raw contact contains (name, phone number, email address, etc.).

  • A Contact joins multiple raw contacts into one aggregate. This is what the user perceives as a real contact in the People and Phone apps.

  • A sync adapter synchronizes its raw contacts with its cloud source. It can be bundled with a Market application (examples: Skype, Twitter, Google+).

While users deal with contacts, sync adapters work with their raw contact rows. They own the data inside a raw contact, but by design it is left up to Android to properly join raw contact rows with others.

Contacts sync adapters have a special xml file that describes their content, which is documented in the Android SDK. In the following paragraphs, we'll assume this file is named contacts.xml.

The Android SDK also contains the application SampleSyncAdapter (and its source code) that implements everything mentioned in here in an easy to understand way.

High resolution photos

In Android versions prior to Honeycomb (3.0), contact photos used to be 96x96. Starting with ICS, they now have a thumbnail (which is the 96x96 version) and a display photo. The display photo's maximum size can vary from device to device (On Galaxy Nexus and Nexus S, it is currently configured to be 256x256, but expect this to vary with future devices). The size as configured can be queried like this:

private static int getPhotoPickSize(Context context) {    // Note that this URI is safe to call on the UI thread.    Cursor c = context.getContentResolver().query(DisplayPhoto.CONTENT_MAX_DIMENSIONS_URI,        new String[]{ DisplayPhoto.DISPLAY_MAX_DIM }, null, null, null);    try {      c.moveToFirst();      return c.getInt(0);    } finally {      c.close();    }  }

This value is useful if you need to query the picture from the server (as you can specify the right size for the download). If you already have a high resolution picture, there is no need for any resizing on your side; if it is too big, the contacts provider will downsample it automatically.

Up until now, pictures were written using a ContentValues object, just like all the other data rows of the raw contact. While this approach is still supported, it might fail when used with bigger pictures, as there is a size limit when sending ContentValues across process boundaries. The prefered way now is to use an AssetFileDescriptor and write them using a FileOutputStream instead:

private static void saveBitmapToRawContact(Context context, long rawContactId, byte[] photo) throws IOException {      Uri rawContactUri = ContentUris.withAppendedId(RawContacts.CONTENT_URI, rawContactId);      Uri outputFileUri =          Uri.withAppendedPath(rawContactUri, RawContacts.DisplayPhoto.CONTENT_DIRECTORY);      AssetFileDescriptor descriptor = context.getContentResolver().openAssetFileDescriptor(          outputFileUri, 'rw');      FileOutputStream stream = descriptor.createOutputStream();      try {        stream.write(photo);      } finally {        stream.close();        descriptor.close();      }  }

For best results, store uncompressed square photos and let the contacts provider take care of compressing the photo. It will create both a thumbnail and a display photo as necessary.

This API is available on API version 14+. For older versions, we recommend to fallback to the old method using ContentValues and assuming a constant size of 96x96.

Update streams

The API for update streams is the biggest new addition for contacts in Ice Cream Sandwich. Sync adapters can now enrich their contact data by providing a social stream that includes text and photos.

This API is intended to provide an entry point into your social app to increase user engagement. We chose to only surface the most recent few stream items, as we believe that your social app will always be the best way to interact with posts on your network.

StreamItems rows are associated with a raw contact row. They contain the newest updates of that raw contact, along with text, time stamp and comments. They can also have pictures, which are stored in StreamItemPhotos. The number of stream items per raw contact has a limit, which on the current Nexus devices is set to 5, but expect this number to change with future devices. The limit can be queried like this:

private static int getStreamItemLimit(Context context) {    // Note that this URI is safe to call on the UI thread.    Cursor c = context.getContentResolver().query(StreamItems.CONTENT_LIMIT_URI,        new String[]{ StreamItems.MAX_ITEMS }, null, null, null);    try {      c.moveToFirst();      return c.getInt(0);    } finally {      c.close();    }  }

When displayed in the People app, stream items from all participating raw contacts will be intermixed and shown chronologically.

The following function shows how to add a stream item to an existing raw contact:

private static void addContactStreamItem(Context context, long rawContactId, String text,      String comments, long timestamp, String accountName, String accountType){    ContentValues values = new ContentValues();    values.put(StreamItems.RAW_CONTACT_ID, rawContactId);    values.put(StreamItems.TEXT, 'Breakfasted at Tiffanys');    values.put(StreamItems.TIMESTAMP, timestamp);    values.put(StreamItems.COMMENTS, comments);    values.put(StreamItems.ACCOUNT_NAME, accountName);    values.put(StreamItems.ACCOUNT_TYPE, accountType);    context.getContentResolver().insert(StreamItems.CONTENT_URI, values);  }

You can also specify an action that should be executed when a stream item or one of its photos is tapped. To achieve this, specify the receiving Activities in your contacts.xml using the tags viewStreamItemActivity and viewStreamItemPhotoActivity:

<ContactsAccountType    xmlns:android='http://schemas.android.com/apk/res/android'    viewStreamItemActivity='com.example.activities.ViewStreamItemActivity"    viewStreamItemPhotoActivity='com.example.activities.ViewStreamItemPhotoActivity'>    <!-- Description of your data types -->  </ContactsAccountType>

Update streams are available on API version 15+ and are intended to replace the StatusUpdate API. For previous versions, we recommend that you fall back to the StatusUpdates API, which only shows a single text item and no pictures.

"Me" profile

Ice Cream Sandwich is the first version of Android that supports the "Me" contact, which is prominently shown at the top of the list of the new People app. This simplifies use-cases that used to be a multi-tap process in previous versions — for example, sharing personal contact data with another person or "navigating home" in a navigation app. Also it allows applications to directly address the user by name and show their photo.

The "Me" profile is protected by the new permissions READ_PROFILE and WRITE_PROFILE. The new functionality is powerful; READ_PROFILE lets developers access users' personally identifying information. Please make sure to inform the user on why you require this permission.

The entry point to the new API is ContactsContract.Profile and is available on API version 14+.

Add connection

Previously, connecting with users on a social network involved opening the respective social networking app, searching for the person and then connecting ("Friend", "Follow" etc.). Ice Cream Sandwich has a much slicker approach: When looking at an existing contact in the People application, the user can decide to add this person to another network as well. For example, the user might want to follow a person on Google+ that they already have as a contact in Gmail.

Once the user taps one of the "Add connection" commands, the app is launched and can look for the person using the information that is already in the contact. Search criteria are up to the app, but good candidates are name, email address or phone number.

To specify your "Add connection" menu item, use the attributes inviteContactActivity and inviteContactActionLabel in your contacts.xml:

<ContactsAccountType    xmlns:android='http://schemas.android.com/apk/res/android'    inviteContactActivity='com.example.activities.InviteContactActivity'    inviteContactActionLabel='@string/invite_action_label'>    <!-- Description of your data types -->  </ContactsAccountType>

Be sure to use the same verb as you typically use for adding connections, so that in combination with your app icon the user understands which application is about to be launched.

The "Add connection" functionality is available on API version 14+.

Contact-view notification

High-resolution pictures need a lot of space, and social streams quickly become outdated. It is therefore not a good idea to keep the whole contacts database completely in sync with the social network. A well-written sync adapter should take importance of contacts into account; as an example, starred contacts are shown with big pictures, so high-resolution pictures are more important. Your network might also have its own metrics that can help to identify important contacts.

For all other contacts, you can register to receive a notification which is sent by the People app to all sync adapters that contribute to a contact whenever the contact's detail page is opened. At that point, you can provide additional information. As an example, when the Google+ sync adapter receives this notification, it pulls in the high-resolution photo and most recent social stream posts for that user and writes them to the contacts provider. This can be achieved by adding the viewContactNotifyService attribute to contacts.xml:

<ContactsAccountType    xmlns:android='http://schemas.android.com/apk/res/android'    viewContactNotifyService='com.example.notifier.NotifierService'>    <!-- Description of your data types -->  </ContactsAccountType>

When this Intent is launched, its data field will point to the URI of the raw contact that was opened.

These notifications are available with API version 14+.

Summary

With Ice Cream Sandwich, we improved key areas around high resolution photos and update streams, and simplified the creation of new connections.

Everything outlined in here is done using open APIs that can be implemented by any network that wants to participate. We're excited to see how developers take advantage of these new features!

sábado, 13 de octubre de 2012

Pirates & Traders

Pirates & Traders es un divertido juego de rol ambientado en el Mar Caribe. Tendremos que elegir nuestro destino como capitán de barco, convertirnos en un pirata o ser un honrado mercader.

Comenzaremos con un pequeño barco y una patente de corso del país que seleccionemos, el resto del juego dependerá de las decisiones que vayamos tomando.....




Algunas de las características de las que dispone el juego:

- 5 habilidades diferentes: Esgrima, Vela, artillería, carisma y astucia
- 20 barcos históricos diferentes
- Personaliza tus naves con 12 diferentes mejoras

Mientras surcamos el caribe tendremos encuentros con otros barcos,  tendremos que decidir si entablamos batalla o por el contrario huimos. Durante el desarrollo de los combates podemos acercarnos o alejarnos, disparar a distintas partes del barco contrario e incluso intentar abordar al enemigo.

En resumen un buen juego para convertirte en un auténtico pirata del caribe.

Algunas capturas del juego


Para descargar el juego basta con escanear el siguiente código QR con Barcode Scanner o Bidi


lineas eroticas

sábado, 22 de septiembre de 2012

Linterna Led es una aplicación que en mas de una ocasión puede que nos solucione algún problema en alguna situación que no dispongamos de una linterna.He utilizado el potente flash led de la cámara , teniendo un control del flash con las opciones de la aplicación en modo Activado y Desactivado, el modo activado no permite el bloqueo de la pantalla manteniendo el flash activo, el modo Desactivado


miércoles, 19 de septiembre de 2012

Top Ten Emerging Technologies for the Environment

Live Science has ranked the top ten emerging environmental technologies in a slide show format. Among the top-rated concepts (not all of which are new) that have the promise to reduce waste, conserve energy and protect natural resources are electronic paper, decontaminating microbes, and energy from waves and ocean temperature.

martes, 18 de septiembre de 2012

LG presenta el Prada 3.0

LG Electronics y la firma de moda Prada han presentado de forma oficial el LG Prada 3.0. Además, lo han hecho a lo grande, contando con el actor estadounidense Edward Norton y la modelo canadiense (aunque de origen ucraniano) Daria Werbowy como caras visibles de la campaña publicitaria, para la que el fotógrafo británico David Sims ha capturado unas elegantes fotografías en blanco y negro.

En cuanto a las características del terminal, el comunicado de LG no da muchos detalles, aunque podemos saber más en la web oficial del terminal. Allí se asegura que combina el estilo de Prada con la tecnología innovadora de LG y presume de tener una de las pantallas táctiles más grandes (4,3 pulgadas y 800 x 480 píxeles) y brillantes (800 nits) del mercado.

También sabemos que el LG Prada 3.0 incluye un procesador de doble núcleo a 1 GHz, 8 GB de memoria interna y una cámara de fotos trasera de 8 megapíxeles con autoenfoque y flash LED. El Prada 3.0 que corre sobre sistema operativo Android en su versión Gingerbread, aunque con una interfaz propia completamente personalizada.

Su diseño es sencillo, elegante, con predominio de las líneas rectas y en la parte trasera muestra el patrón típico de Prada junto a su conocido logotipo. Entre lo más destacable está el grosor del terminal que es de sólo 8,5 milímetros.

Los compradores de este exclusivo terminal podrán adquirir una base de carga a juego, una amplia gama de fundas y un auricular Bluetooth. Tampoco se dice en el anuncio oficial cuál será el precio del dispositivo, pero podemos estar seguros de que no será en absoluto barato.

martes, 11 de septiembre de 2012

Móviles resistentes y sumergibles en TelefonosTodoterreno.es

No se la cantidad de veces que se me ha caído el teléfono, desde alturas pequeñas como grandes y gracias a dios por ahora sigue funcionando.....pero miedo me da que tras alguna caída el teléfono deje de funcionar como ya me ocurrió una vez.

Ante el miedo de que se  me rompa el teléfono he buscado por internet  algunas soluciones y me he encontrado con la web http://www.telefonostodoterreno.es


En la web se pueden encontrar gran cantidad de teléfonos donde la característica fundamental de todos ellos son su gran resistencia y muchos de ellos con prestaciones de valor añadido. Otra de las cualidades que presentan los teléfonos de esta web, es que todos son terminales libres, lo que te permitirá cambiar de compañía sin tener que preocuparte por buscar un nuevo terminal.

Además de terminales telefónicos también disponen de una 'Zona Gadget' donde se pueden encontrar productos muy interesantes como videocámaras sumergibles o cámaras de fotos todo terreno, capaces de soportar golpes y caídas.


Una web muy interesante para localizar teléfonos resistentes ya sea por que por tu trabajo necesitas un teléfono resistente y duradero o simplemente por que deseas tener un terminal capaz de resistir golpes o caídas y que funcione como el primer día. Visita la web

  


lunes, 10 de septiembre de 2012

Handy Recovery Herramienta para recuperar archivos borrados


Nos hemos propuesto traer al blog una serie de herramientas útiles para la recuperación de datos, particiones y ficheros luego de que nos ocurra un accidente informático de los que solemos conocer: infección por virus, borrado de un archivo por error, vaciado de la papelera de reciclaje con archivos que no debíamos borrar, formateo del disco, entre otros.
Handy Recovery es el primer candidato de nuestra lista,  un programa que te permitirá de manera sencilla recuperar archivos eliminados del tipo descrito anteriormente, incluso si has eliminado la partición y has vuelto a instalar windows podrás posiblemente en unos sencillos pasos recuperar tu carpeta de documentos u otra información que no pudiste salvar. Esto claro está, en dependencia del uso que le has dado a tu disco duro y al tiempo atrás en que hayas borrado estos archivos, porque en dependencia de si esos datos están disponibles es que se hace efectiva la recuperación, mientras más reutilices tu disco duro menos probabilidades de recuperación, con este y con otro soft, la recuperación de datos es una tarea que se puede tonar tediosa y larga,en dependencia de la cantidad de información y los tamaños de nuestros discos.


La empresa productora de Handy Recovery vende el producto a 49 dólares, pero nos  lo deja probar en una versión trial por 30 días, período en el cual podrás recuperar 1 archivo diario, esta es la parte triste de la versión, cuando existen otros software que en un versión de pruebas son un poco más bondadosos.
Handy Recovery tiene una interfaz sencilla y amigable, no hay que ser un experto para recuperar tus archivos eliminados, solo tienes que buscar en la unidad  de disco que le indiques e ir recorriendo la lista de carpetas y ficheros los cuales podrás ir marcando para recuperar. El programa tiene una opción búsqueda de archivos por máscaras lo cual te facilitará el trabajo así como una vista previa de los archivos que vayas seleccionando.
Resumiendo no esperes milagros del programa pero sino eres un experto por aquí podrás comenzar a recuperar los archivos que borraste por algún accidente.


Compatibilidad: Microsoft Windows 9x/Me/NT/2000/XP/2003/Vista