Sólo se le podía ocurrir a un symio

I've pushed you down deep in my soul for too long
Etiquetas: pelotillas en el ombligo, viaje
Etiquetas: tonterias
Etiquetas: android, Android公司的电脑
Aparte de la segunda ronda del ADC actual existirá otra, bajo unas condiciones semejantes, a finales de este año, dada la acogida que por lo visto ha tenido el concurso... de acuerdo con uno de los desarrolladores:
"...There are two Challenges, which we call Challenge 1 and Challenge 2. Each
of these is allocated half of the $10,000,000 fund. Challenge 1 is the one
going on right now; Challenge 2 will begin later this year, after Challenge
1 has concluded.
Challenge 1, meanwhile, is broken into two parts and has two deadlines. The
first deadline is for anyone to submit an application (according to the
eligibility rules); this is the April 14th deadline, and we call it Round
1. Judges will then evaluate and choose the best submissions, and those
developers will receive $25,000. They'll also be given a period of time --
which we call Round 2 -- to further polish their applications, and submit
the new versions by a second deadline. The winners of the final, larger
prizes will be chosen out of the Round 2 submissions. Only developers who
are awarded a prize in Round 1 will be eligible to submit for Round 2.
To summarize: Challenge 1 has two phases, Round 1 and Round 2. Only
winners of Round 1 may participate in Round 2. Challenge 2 will begin later
this year, and will be a totally separate event. "
Etiquetas: android, Android公司的电脑, segundo ADC, الروبوت, स्वागतम् سڤاڽول, 안드로이드, 人造コンピュータ
Bien, hoy vamos a hablar de recursos, sobre cómo incluirlos en nuestro código de manera que queden correctamente agrupados en la aplicación.
Tenemos tres alternativas para hacerlo:
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<Button
android:id="@+id/btn1"
android:layout_width="83px"
android:layout_height="wrap_content"
android:text="Abrir asset"
android:layout_x="10px"
android:layout_y="352px"
>
</Button>
<Button
android:id="@+id/btn2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="guardar "
android:layout_x="100px"
android:layout_y="352px"
>
</Button>
<Button
android:id="@+id/btn3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Abrir"
android:layout_x="180px"
android:layout_y="352px"
>
</Button>
<EditText
android:id="@+id/texto"
android:layout_width="197px"
android:layout_height="217px"
android:text=""
android:layout_x="20px"
android:layout_y="22px"
>
</EditText>
</AbsoluteLayout>
package mi.paquete.test1;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import android.util.Log;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
public class Actividad extends Activity {
private static final String TAG = "Actividad";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
//Accedemos al los objetos creados a través de su identificador
final EditText texto = (EditText) this.findViewById(R.id.texto);
Button btn1 = (Button) this.findViewById(R.id.btn1);
Button btn2 = (Button) this.findViewById(R.id.btn2);
Button btn3 = (Button) this.findViewById(R.id.btn3);
btn1.setOnClickListener(new OnClickListener(){
//Accion a realizar en el click del boton 1
public void onClick(View vista) {
InputStream is;
try {
is = Actividad.this.getAssets().open("archivoprueba.txt");
int tam = is.available();
byte [] buffer = new byte[tam];
is.read(buffer);
texto.setText(new String(buffer));
} catch (IOException e) {
Log.d(TAG,"Error en la lectura",e);
}
}
});
btn2.setOnClickListener(new OnClickListener(){
//Accion a realizar en el click del boton 2
public void onClick(View vista) {
try {
FileOutputStream fos =Actividad.this.openFileOutput("archivoprueba2.txt", MODE_WORLD_READABLEMODE_WORLD_WRITEABLE);
fos.write(texto.getText().toString().getBytes());
fos.close();
} catch (IOException e) {
Log.d(TAG,"Error en la escritura",e);
}
}
});
btn3.setOnClickListener(new OnClickListener(){
//Accion a realizar en el click del boton 3
public void onClick(View vista) {
try {
FileInputStream fis = Actividad.this.openFileInput("archivoprueba2.txt");
int tam = fis.available();
byte [] buffer = new byte[tam];
fis.read(buffer);
texto.setText(new String(buffer));
fis.close();
} catch (IOException e) {
Log.d(TAG,"Error en la lectura",e);
}
}
});
}
}
public final class R {
//...
public static final class id {
public static final int btn1=0x7f050000;
public static final int btn2=0x7f050001;
public static final int btn3=0x7f050002;
public static final int texto=0x7f050003;
}
public static final class layout {
public static final int main=0x7f030000;
}
//...
}
Etiquetas: ficheros android abrir, imagenes
Bien, si todo fue cómo esperábamos en el post anterior ( y confío en vosotros) ya tenemos un entorno adecuado de trabajo (lo siento chicos Solaris, muy probablemente vosotros no estáis en la lista...guaguaguaguaaaaa -sonido de trompetas-).
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package mi.paquete.test1;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int icon=0x7f020000;
}
public static final class layout {
public static final int main=0x7f030000;
}
public static final class string {
public static final int app_name=0x7f040000;
}
}
Etiquetas: android, Android公司的电脑, BattleStar Galactica, ojo de cylon, Ջոբս Սթիվ, الروبوت, स्वागतम् سڤاڽول, 人造コンピュータ
Curioso:
"Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in..."
Etiquetas: programacion
May 12, 2008. Monday.
Your android application is not in the top 50 ADC winners list.
Dear Android Developer Challenge losers,
I know you are drunk. I know you are hung over. I know you are feeling terrible. I know you are at your lows. I know life sucks. I know you can't get out of your bed. But wake up, will ya?
Your android application is not in the top 50 winners list. Cool. Take a deep breath. Look outside. Anything changed? Nah.. nothing changed. Your wife loves you as much as she did before. Your kids love you as much as they did before. Your friends love you just like before. You must do the same.
You must do the same to your Android application. Give it the same love, will ya?
First thing first, Send out your congratulations to the top 50 winners. Yes, you heard me right. Do it now, and do it fast. Better? It felt good right?
Yeah I know, It feels great. Wonderful.
Now that you are feeling better, let me tell you this:
Etiquetas: Nothing else matters
Etiquetas: 3 libras, android, programacion, tonterias, Բայրոն Ադաm, Ռամշտայնը, स्वागतम् سڤاڽول, 人造コンピュータ
Tenemos todo el conocimiento del mundo a nuestros pies, de todo el mundo.
Como una inmensa playa.
El conocimiento esta esparcido en los millones de granos de arena de la costa, sin considerar la procedencia de cada partícula, simplemente depositando herráticamente cada grano que ha sido arrastrado hasta allí.
Olas lamen nuestros pies mientras caminamos, dejando minúsculas notas de conocimiento que no llegamos a apreciar.
Pero vemos, más al fondo, lejos de la costa, castillos de arena que jamás llegaremos a poder construir y nos regodeamos en nuestras ignorancia, sin darnos cuenta del conocimiento que, sin quererlo, ya nos acompaña.
Así es esto, así es todo.
Etiquetas: tonterias, topollillo