Aplicaciones, juegos y Código Android.

dilluns, 27 d’octubre del 2014

Calculadora de Ofertas

NUEVA APP. Calculadora de Ofertas.
 Compara OFERTAS. Introduce las cantidades y el precio, y te calculará el precio o el tamaño que buscas.
Es orientativo, y los precios deberían ser menores a los calculados para que sea realmente una oferta.
También calcula el precio para diferentes packs.

diumenge, 8 de desembre del 2013

Números al azar. NUEVA APP

Juegas a la lotería, euromillon, bonoloto,etc?, o cualquier tipo de juego de azar? ESTA ES TU APP.

Esta nueva app va dirigida a toda esa gente que quiere una combinación totalmente al azar y sin ningún tipo de intermediarios. Es una app totalmente independiente a los juegos de azar. Te permite crear combinaciones de dos, tres, y hasta siete cifras, dando la posibilidad también de hacer una sola tirada para decidir un ganador. La tirada de la suerte: "...di un numero del uno al diez...".
Ocupa muy poco espacio, unos 800kb, ideal para cualquier dispositivo android con una versión mínima de 2.2. Prueba y danos tu opinión.
Suerte...

dissabte, 7 de desembre del 2013

ESCONDER TECLADO (hide keyboard)


public boolean onTouchEvent(MotionEvent event) {

        hideSoftKeyboard(LoginActivity.this);
        return false;

    }

    public static void hideSoftKeyboard(Activity activity) {

        InputMethodManager inputMethodManager = (InputMethodManager)
        activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
        inputMethodManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 0);

    }

divendres, 6 de desembre del 2013

COMO CAMBIAR DE ORIENTACION EN DIFERENTES DISPOSITIVOS

Para poder diferenciar entre diferentes tipos de pantalla(telefono, tablet 7" o 10") tenemos diferentes maneras. Una de ellas es colocando un diferenciador de pantalla en el código. Esto hará que varie la orientación dependiendo del dispositivo donde se ejecute la aplicación.

SIMPLEMENTE COLOCOMAOS ESTE CÓDIGO DENTRO DE onCreate(), Y LISTO, LA APP DECIDIRÁ QUE ORIENTACIÓN ESCOJER SEGÚN LA MEDIDA DE LA PANTALLA.

if ((getResources().getConfiguration().screenLayout &      Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE) {
            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        }
        else if ((getResources().getConfiguration().screenLayout &      Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE) {
            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        }
        else if ((getResources().getConfiguration().screenLayout &      Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_NORMAL) {
            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        }
        else if ((getResources().getConfiguration().screenLayout &      Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_SMALL) {
            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        }
        else {
            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);       

 }

LISTADO DE VALUES PARA MANEJO DE IDIOMA EN ANDROID

Para poder adaptar nuestro proyecto a varios idiomas devemos añadir carpetas con los valores que tendrá cada uno de ellos.
Las carpetas van uvicadas en /res/ y se llaman /res/values/ para el que serán los valores estandar, y /res/values-en/ por ejemplo para los los valores en inglés.
Os dejo un enlace donde podreis ver un listado con los prefijos mas utilizados en ISO 639-1.

dijous, 5 de desembre del 2013

PROBLEMAS AL PUBLICAR APP CON ANDROID STUDIO

Cuando usamos ANDROID STUDIO y queremos publicar nuestra aplicación al market nos pide que depuremos nuestra APP. Para resolver esto solo tenemos que colocar el siguiente código dentro del apartado <application> del archivo AndroidManifest.xml:

<application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme"
        android:debuggable="false">
        <activity