Guest User

Untitled

a guest
Feb 18th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.31 KB | None | 0 0
  1. private void escribirFicheroMemoriaInterna()
  2. {
  3. OutputStreamWriter escritor=null;
  4. try
  5. {
  6. escritor=new OutputStreamWriter(openFileOutput("pruebaFichero.txt", Context.MODE_PRIVATE));
  7. escritor.write(tbTexto.getText().toString());
  8. }
  9. catch (Exception ex)
  10. {
  11. Log.e("ivan", "Error al escribir fichero a memoria interna");
  12. }
  13. finally
  14. {
  15. try {
  16. if(escritor!=null)
  17. escritor.close();
  18. } catch (IOException e) {
  19. e.printStackTrace();
  20. }
  21. }
  22. }
  23.  
  24.  
  25. private void leerFicheroMemoriaInterna()
  26. {
  27. InputStreamReader flujo=null;
  28. BufferedReader lector=null;
  29. try
  30. {
  31. flujo= new InputStreamReader(openFileInput("pruebaFichero.txt"));
  32. lector= new BufferedReader(flujo);
  33. String texto = lector.readLine();
  34. while(texto!=null)
  35. {
  36. tbTexto.setText(texto);
  37. texto=lector.readLine();
  38. }
  39. }
  40. catch (Exception ex)
  41. {
  42. Log.e("ivan", "Error al leer fichero desde memoria interna");
  43. }
  44. finally
  45. {
  46. try {
  47. if(flujo!=null)
  48. flujo.close();
  49. } catch (IOException e) {
  50. e.printStackTrace();
  51. }
  52. }
  53. }
  54.  
  55. ...
  56.  
  57. public class Calentando extends AppCompatActivity {
  58.  
  59. public String rx = "190";
  60. public TextView Tempview;
  61. static final int READ_BLOCK_SIZE = 100;
  62.  
  63.  
  64. @Override
  65. protected void onCreate(Bundle savedInstanceState) {
  66. super.onCreate( savedInstanceState );
  67. getWindow().setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN,
  68. WindowManager.LayoutParams.FLAG_FULLSCREEN );
  69. setContentView( R.layout.activity_calentando );
  70. }
  71.  
  72. {
  73. try {
  74. FileInputStream in = openFileInput( "value" );
  75. InputStreamReader inputStreamReader = new InputStreamReader( in );
  76. BufferedReader bufferedReader = new BufferedReader( inputStreamReader );
  77. StringBuilder sb = new StringBuilder();
  78. String line;
  79.  
  80. while ((line = bufferedReader.readLine()) != null) {
  81. sb.append( line );
  82. }
  83. inputStreamReader.close();
  84. Tempview = (TextView) findViewById( R.id.temperatura );
  85. Tempview.setText( line ) ;
  86.  
  87. } catch (FileNotFoundException e) {
  88. e.printStackTrace();
  89. } catch (IOException e) {
  90. e.printStackTrace();
  91. }
  92. }
  93.  
  94. }
  95.  
  96.  
  97.  
  98. 01-01 08:18:20.191 4940-4940/com.serial.www.qualit W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --compiler-filter=interpret-only --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.serial.www.qualit-2/split_lib_dependencies_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.serial.www.qualit-2@split_lib_dependencies_apk.apk@classes.dex) because non-0 exit status
  99. 01-01 08:18:20.486 4940-4940/com.serial.www.qualit W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --compiler-filter=interpret-only --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.serial.www.qualit-2/split_lib_slice_0_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.serial.www.qualit-2@split_lib_slice_0_apk.apk@classes.dex) because non-0 exit status
  100. 01-01 08:18:20.563 4940-4940/com.serial.www.qualit W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --compiler-filter=interpret-only --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.serial.www.qualit-2/split_lib_slice_1_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.serial.www.qualit-2@split_lib_slice_1_apk.apk@classes.dex) because non-0 exit status
  101. 01-01 08:18:20.632 4940-4940/com.serial.www.qualit W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --compiler-filter=interpret-only --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.serial.www.qualit-2/split_lib_slice_2_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.serial.www.qualit-2@split_lib_slice_2_apk.apk@classes.dex) because non-0 exit status
  102. 01-01 08:18:20.709 4940-4940/com.serial.www.qualit W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --compiler-filter=interpret-only --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.serial.www.qualit-2/split_lib_slice_3_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.serial.www.qualit-2@split_lib_slice_3_apk.apk@classes.dex) because non-0 exit status
  103. 01-01 08:18:20.776 4940-4940/com.serial.www.qualit W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --compiler-filter=interpret-only --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.serial.www.qualit-2/split_lib_slice_4_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.serial.www.qualit-2@split_lib_slice_4_apk.apk@classes.dex) because non-0 exit status
  104. 01-01 08:18:20.841 4940-4940/com.serial.www.qualit W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --compiler-filter=interpret-only --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.serial.www.qualit-2/split_lib_slice_5_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.serial.www.qualit-2@split_lib_slice_5_apk.apk@classes.dex) because non-0 exit status
  105. 01-01 08:18:20.904 4940-4940/com.serial.www.qualit W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --compiler-filter=interpret-only --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.serial.www.qualit-2/split_lib_slice_6_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.serial.www.qualit-2@split_lib_slice_6_apk.apk@classes.dex) because non-0 exit status
  106. 01-01 08:18:20.975 4940-4940/com.serial.www.qualit W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --compiler-filter=interpret-only --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.serial.www.qualit-2/split_lib_slice_7_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.serial.www.qualit-2@split_lib_slice_7_apk.apk@classes.dex) because non-0 exit status
  107. 01-01 08:18:21.043 4940-4940/com.serial.www.qualit W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --compiler-filter=interpret-only --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.serial.www.qualit-2/split_lib_slice_8_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.serial.www.qualit-2@split_lib_slice_8_apk.apk@classes.dex) because non-0 exit status
  108. 01-01 08:18:21.108 4940-4940/com.serial.www.qualit W/art: Failed execv(/system/bin/dex2oat --runtime-arg -classpath --runtime-arg --debuggable --compiler-filter=interpret-only --instruction-set=arm64 --instruction-set-features=smp,a53 --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --runtime-arg -Xms64m --runtime-arg -Xmx512m --instruction-set-variant=generic --instruction-set-features=default --dex-file=/data/app/com.serial.www.qualit-2/split_lib_slice_9_apk.apk --oat-file=/data/dalvik-cache/arm64/data@app@com.serial.www.qualit-2@split_lib_slice_9_apk.apk@classes.dex) because non-0 exit status
  109. 01-01 08:18:21.111 4940-4940/com.serial.www.qualit W/System: ClassLoader referenced unknown path: /data/app/com.serial.www.qualit-2/lib/arm64
  110. 01-01 08:18:21.250 4940-4940/com.serial.www.qualit W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
  111. 01-01 08:18:21.751 4940-4940/com.serial.www.qualit W/art: Before Android 4.1, method int android.support.v7.widget.DropDownListView.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
  112. 01-01 08:18:27.868 4940-4940/com.serial.www.qualit E/AndroidRuntime: FATAL EXCEPTION: main
  113. Process: com.serial.www.qualit, PID: 4940
  114. java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.serial.www.qualit/com.serial.www.qualit.Calentando}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.FileInputStream android.content.Context.openFileInput(java.lang.String)' on a null object reference
  115. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2327)
  116. at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
  117. at android.app.ActivityThread.-wrap11(ActivityThread.java)
  118. at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
  119. at android.os.Handler.dispatchMessage(Handler.java:102)
  120. at android.os.Looper.loop(Looper.java:148)
  121. at android.app.ActivityThread.main(ActivityThread.java:5417)
  122. at java.lang.reflect.Method.invoke(Native Method)
  123. at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:742)
  124. at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:632)
  125. Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.FileInputStream android.content.Context.openFileInput(java.lang.String)' on a null object reference
  126. at android.content.ContextWrapper.openFileInput(ContextWrapper.java:177)
  127. at com.serial.www.qualityfry.Calentando.<init>(Calentando.java:92)
  128. at java.lang.Class.newInstance(Native Method)
  129. at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
  130. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2317)
  131. at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
  132. at android.app.ActivityThread.-wrap11(ActivityThread.java)
  133. at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
  134. at android.os.Handler.dispatchMessage(Handler.java:102)
  135. at android.os.Looper.loop(Looper.java:148)
  136. at android.app.ActivityThread.main(ActivityThread.java:5417)
  137. at java.lang.reflect.Method.invoke(Native Method)
  138. at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:742)
  139. at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:632)
Add Comment
Please, Sign In to add comment