The app works on the emulator but not on a real device (both API 23)

I have an application that I can open and execute on the emulator without error. But when I want to run this app on my real phone (Samsung Galaxy S6 6.0.1), the app doesn't show everything. There are also 2 errors in the log-cat:

    06-14 17:05:13.521 1251-1251/? E/Zygote: v2
    06-14 17:05:13.521 1251-1251/? I/libpersona: KNOX_SDCARD checking this for 10300
    06-14 17:05:13.521 1251-1251/? I/libpersona: KNOX_SDCARD not a persona
    06-14 17:05:13.521 1251-1251/? I/SELinux: Function: selinux_compare_spd_ram, index[1], SPD-policy is existed. and_ver=SEPF_SECMOBILE_6.0.1 ver=11
    06-14 17:05:13.521 1251-1251/? W/SELinux: Function: selinux_compare_spd_ram, index[1], priority [1], priority version is VE=SEPF_SECMOBILE_6.0.1_0011
    06-14 17:05:13.521 1251-1251/? E/Zygote: accessInfo : 0
    06-14 17:05:13.521 1251-1251/? W/SELinux: SELinux: seapp_context_lookup: seinfo=default, level=s0:c512,c768, pkgname=com.example.alexanders916.vertretungsplan 
    06-14 17:05:13.521 1251-1251/? I/art: Late-enabling -Xcheck:jni
    06-14 17:05:13.541 1251-1251/com.example.alexanders916.vertretungsplan D/TimaKeyStoreProvider: TimaSignature is unavailable
    06-14 17:05:13.541 1251-1251/com.example.alexanders916.vertretungsplan D/ActivityThread: Added TimaKeyStore provider
    06-14 17:05:13.561 1251-1251/com.example.alexanders916.vertretungsplan W/ResourcesManager: getTopLevelResources: /data/app/com.example.alexanders916.vertretungsplan-2/base.apk / 1.0 running in com.example.alexanders916.vertretungsplan rsrc of package com.example.alexanders916.vertretungsplan
    06-14 17:05:13.561 1251-1251/com.example.alexanders916.vertretungsplan I/InjectionManager: Inside getClassLibPath + mLibMap{0=, 1=}
    06-14 17:05:13.561 1251-1251/com.example.alexanders916.vertretungsplan D/ResourcesManager: For user 0 new overlays fetched Null
    06-14 17:05:13.561 1251-1251/com.example.alexanders916.vertretungsplan I/InjectionManager: Inside getClassLibPath caller 
    06-14 17:05:13.571 1251-1251/com.example.alexanders916.vertretungsplan W/System: ClassLoader referenced unknown path: /data/app/com.example.alexanders916.vertretungsplan-2/lib/arm64
    06-14 17:05:13.571 1251-1251/com.example.alexanders916.vertretungsplan D/InjectionManager: InjectionManager
    06-14 17:05:13.571 1251-1251/com.example.alexanders916.vertretungsplan D/InjectionManager: fillFeatureStoreMap com.example.alexanders916.vertretungsplan
    06-14 17:05:13.571 1251-1251/com.example.alexanders916.vertretungsplan I/InjectionManager: Constructor com.example.alexanders916.vertretungsplan, Feature store :{}
    06-14 17:05:13.571 1251-1251/com.example.alexanders916.vertretungsplan I/InjectionManager: featureStore :{}
    06-14 17:05:13.571 1251-1251/com.example.alexanders916.vertretungsplan W/ResourcesManager: getTopLevelResources: /data/app/com.example.alexanders916.vertretungsplan-2/base.apk / 1.0 running in com.example.alexanders916.vertretungsplan rsrc of package com.example.alexanders916.vertretungsplan
    06-14 17:05:13.571 1251-1251/com.example.alexanders916.vertretungsplan W/ResourcesManager: getTopLevelResources: /data/app/com.example.alexanders916.vertretungsplan-2/base.apk / 1.0 running in com.example.alexanders916.vertretungsplan rsrc of package com.example.alexanders916.vertretungsplan
    06-14 17:05:13.641 1251-1251/com.example.alexanders916.vertretungsplan I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
    06-14 17:05:13.641 1251-1251/com.example.alexanders916.vertretungsplan I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
    06-14 17:05:13.801 1251-1251/com.example.alexanders916.vertretungsplan D/Activity: performCreate Call Injection manager
    06-14 17:05:13.801 1251-1251/com.example.alexanders916.vertretungsplan I/InjectionManager: dispatchOnViewCreated > Target : com.example.alexanders916.vertretungsplan.MainActivity isFragment :false
    06-14 17:05:13.811 1251-1251/com.example.alexanders916.vertretungsplan D/SecWifiDisplayUtil: Metadata value : SecSettings2
    06-14 17:05:13.811 1251-1251/com.example.alexanders916.vertretungsplan D/ViewRootImpl: #1 mView = com.android.internal.policy.PhoneWindow$DecorView{879e39a I.E...... R.....ID 0,0-0,0}
    06-14 17:05:13.811 1251-1277/com.example.alexanders916.vertretungsplan D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
    06-14 17:05:13.851 1251-1277/com.example.alexanders916.vertretungsplan D/libEGL: loaded /vendor/lib64/egl/libGLES_mali.so
    06-14 17:05:13.901 1251-1277/com.example.alexanders916.vertretungsplan D/libEGL: eglInitialize EGLDisplay = 0x7fa4901178
    06-14 17:05:13.901 1251-1277/com.example.alexanders916.vertretungsplan I/OpenGLRenderer: Initialized EGL, version 1.4
    06-14 17:05:13.911 1251-1277/com.example.alexanders916.vertretungsplan D/mali_winsys: new_window_surface returns 0x3000,  [1440x2560]-format:1
    06-14 17:05:13.921 1251-1251/com.example.alexanders916.vertretungsplan I/InjectionManager: dispatchCreateOptionsMenu :com.example.alexanders916.vertretungsplan.MainActivity
    06-14 17:05:13.921 1251-1251/com.example.alexanders916.vertretungsplan I/InjectionManager: dispatchPrepareOptionsMenu :com.example.alexanders916.vertretungsplan.MainActivity
    06-14 17:05:13.921 1251-1251/com.example.alexanders916.vertretungsplan D/ViewRootImpl: MSG_RESIZED_REPORT: ci=Rect(0, 96 - 0, 0) vi=Rect(0, 96 - 0, 0) or=1
    06-14 17:05:13.931 1251-1251/com.example.alexanders916.vertretungsplan W/DisplayListCanvas: DisplayListCanvas is started on unbinded RenderNode (without mOwningView)
    06-14 17:05:13.931 1251-1277/com.example.alexanders916.vertretungsplan D/libGLESv1: DTS_GLAPI : DTS is not allowed for Package : com.example.alexanders916.vertretungsplan
    06-14 17:05:13.951 1251-1251/com.example.alexanders916.vertretungsplan I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@ff7a606 time:528865674

      

What do the 2 errors mean (E / Zygote: ...)?

Code: `package com.example.alexanders916.vertretungsplan;

import android.content.SharedPreferences;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle;
import android.os.StrictMode;
import android.support.v7.app.AppCompatActivity;
import android.text.method.ScrollingMovementMethod;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TableLayout;
import android.widget.TableRow;
import android.widget.TextView;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.charset.MalformedInputException;
import java.util.Calendar;

public class MainActivity extends AppCompatActivity {
static String defaultGrade=null, line=null;
static final String MY_PREFERENCES = "VPPrefs";
static URL url;
static StringBuffer sb= new StringBuffer();

@Override
protected void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
    StrictMode.setThreadPolicy(policy);
    SharedPreferences sharedPreferences = getSharedPreferences(MY_PREFERENCES, MODE_PRIVATE);
    defaultGrade = sharedPreferences.getString("defaultGrade", "keine");
    defaultGrade="23";
    Calendar c = Calendar.getInstance();
    int day_of_week = c.get(Calendar.DAY_OF_WEEK);
    int week_of_year = c.get(Calendar.WEEK_OF_YEAR);
    int hour_of_day = c.get(Calendar.HOUR_OF_DAY);
    int abzug = 1;
    /************************
     Sunday = 1
     Monday = 2
     Tuesday = 3
     Wednesday = 4
     Thursday = 5
     Friday = 6
     Saturday = 7
     ************************/

    if (day_of_week == 2 || day_of_week == 3 || day_of_week == 4 || day_of_week == 5 || day_of_week == 6) {
        if (hour_of_day >= 13) day_of_week = day_of_week + abzug;
    }
    if (day_of_week == 7 || day_of_week == 1) {
        day_of_week = 2;
        week_of_year = week_of_year + abzug;
    }
    if(week_of_year==20||week_of_year==21){
        day_of_week = 2;
        week_of_year=22;
    }
    try{
        url = new URL("http://mpg-vertretungsplan.de/w/"+(week_of_year-abzug)+"/w000"+defaultGrade+".htm");
    }catch(MalformedURLException e){e.printStackTrace();}

    try{
        InputStream is = (InputStream) url.getContent();
        BufferedReader isReader = new BufferedReader(new InputStreamReader(is));
        while ((line = isReader.readLine()) != null) {
            sb.append(line + "\n");
        }
    }catch(IOException e){e.printStackTrace();}

    String htmlContent = null;
    htmlContent = sb.toString();
    Document doc = Jsoup.parse(htmlContent);
    htmlContent = doc.toString();
    boolean inTable = false;
    int step = 0;
    CharSequence start = "<td class=\"list\" align=\"center\">",
            end = "</td>";

    CharSequence date = null, grade = null, hours = null, subject = null, room = null, oldSubject = null, text = null;
    CharSequence mon = "Montag</b>", die = "Dienstag</b>", mit = "Mittwoch</b>", don = "Donnerstag</b>", fre = "Freitag</b>";
    StringReader strReader = new StringReader(htmlContent);
    BufferedReader cpuReader = new BufferedReader(strReader);
    String sharedDate=null;
    int intColor=1;
    TableLayout tlayout = (TableLayout) findViewById(R.id.tableLayout);
    tlayout.setGravity(Gravity.TOP);

    TextView textGrade = new TextView(this);
    TextView textDate;
    TableRow row = new TableRow(this);
    TableRow row1 = new TableRow(this);
    TextView text1 = new TextView(this);
    TextView text2 = new TextView(this);
    TextView text3 = new TextView(this);
    TextView text4 = new TextView(this);
    TextView text5 = new TextView(this);
    TableRow.LayoutParams marginParams = new TableRow.LayoutParams(
            TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT);
    marginParams.width = 0;
    marginParams.weight = 1;
    marginParams.gravity = Gravity.CENTER;

    TableRow.LayoutParams marginParams2 = new TableRow.LayoutParams(
            TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT);
    marginParams2.width = 0;
    marginParams2.weight = 1;
    marginParams2.gravity = Gravity.START;
    marginParams2.span = 1;

    getGrade();
    textGrade.setText("Klasse " + defaultGrade + "\n");
    textGrade.setTextColor(Color.BLACK);
    textGrade.setTypeface(null, Typeface.BOLD);
    textGrade.setTextSize(TypedValue.COMPLEX_UNIT_SP, 20);
    row1.addView(textGrade, marginParams2);
    text1.setText("Stunde");
    row.addView(text1, marginParams);
    text2.setText("Fach");
    row.addView(text2, marginParams);
    text3.setText("Raum");
    row.addView(text3, marginParams);
    text4.setText("statt");
    row.addView(text4, marginParams);
    text5.setText("Text");
    row.addView(text5, marginParams);
    tlayout.addView(row1);
    tlayout.addView(row);
    try{
        while ((line = cpuReader.readLine()) != null) {
            switch(step){
                case 8:
                    step=9;
                    row = new TableRow(this);
                    switch(intColor){
                        case 1:
                            row.setBackgroundColor(Color.parseColor("#FFCF9A"));
                            //row.setBackgroundColor(Color.parseColor("#FFE7CD"));
                            intColor=0;
                            break;
                        case 0:
                            //row.setBackgroundColor(Color.parseColor("#CDFAFF"));
                            row.setBackgroundColor(Color.parseColor("#FFE7CD"));
                            intColor=1;
                            break;
                    }
                    text1 = new TextView(this);
                    text1.setTextColor(Color.BLACK);
                    text2 = new TextView(this);
                    text2.setTextColor(Color.BLACK);
                    text3 = new TextView(this);
                    text3.setTextColor(Color.BLACK);
                    text4 = new TextView(this);
                    text4.setTextColor(Color.BLACK);
                    text5 = new TextView(this);
                    text5.setTextColor(Color.BLACK);

                    text1.setText(" "+hours);
                    row.addView(text1, marginParams);
                    text2.setText(subject);
                    row.addView(text2, marginParams);
                    text3.setText(room);
                    row.addView(text3, marginParams);
                    text4.setText(oldSubject);
                    row.addView(text4, marginParams);
                    text5.setText(text);
                    text5.setMaxLines(3);
                    text5.setVerticalScrollBarEnabled(true);
                    text5.setMovementMethod(new ScrollingMovementMethod());
                    row.addView(text5, marginParams);
                    tlayout.addView(row);
            }
            if(line.contains(mon))sharedDate="\n\n"+"Montag:";
            if(line.contains(die))sharedDate="\n\n"+"Dienstag:";
            if(line.contains(mit))sharedDate="\n\n"+"Mittwoch:";
            if(line.contains(don))sharedDate="\n\n"+"Donnerstag:";
            if(line.contains(fre))sharedDate="\n\n"+"Freitag:";
            if(line.contains("</tr>"))inTable=false;
            if(inTable){
                switch(sharedDate){
                    case "\n\n"+"Montag:":
                        row = new TableRow(this);
                        textDate = new TextView(this);
                        textDate.setTypeface(null, Typeface.BOLD);
                        textDate.setTextColor(Color.BLACK);
                        textDate.setText(sharedDate);
                        row.addView(textDate);
                        tlayout.addView(row);
                        sharedDate="null";
                        intColor = 1;
                        break;
                    case "\n\n"+"Dienstag:":
                        row = new TableRow(this);
                        textDate = new TextView(this);
                        textDate.setTypeface(null, Typeface.BOLD);
                        textDate.setTextColor(Color.BLACK);
                        textDate.setText(sharedDate);
                        row.addView(textDate);
                        tlayout.addView(row);
                        sharedDate="null";
                        intColor=1;
                        break;
                    case "\n\n"+"Mittwoch:":
                        row = new TableRow(this);
                        textDate = new TextView(this);
                        textDate.setTypeface(null, Typeface.BOLD);
                        textDate.setTextColor(Color.BLACK);
                        textDate.setText(sharedDate);
                        row.addView(textDate);
                        tlayout.addView(row);
                        sharedDate="null";
                        intColor=1;
                        break;
                    case "\n\n"+"Donnerstag:":
                        row = new TableRow(this);
                        textDate = new TextView(this);
                        textDate.setTypeface(null, Typeface.BOLD);
                        textDate.setTextColor(Color.BLACK);
                        textDate.setText(sharedDate);
                        row.addView(textDate);
                        tlayout.addView(row);
                        sharedDate="null";
                        intColor=1;
                        break;
                    case "\n\n"+"Freitag:":
                        row = new TableRow(this);
                        textDate = new TextView(this);
                        textDate.setTypeface(null, Typeface.BOLD);
                        textDate.setTextColor(Color.BLACK);
                        textDate.setText(sharedDate);
                        row.addView(textDate);
                        tlayout.addView(row);
                        sharedDate="null";
                        intColor=1;
                        break;
                }
                switch(step){
                    case 1:
                        int beginIndex = line.indexOf(start.toString()) + start.length();
                        int endIndex = line.indexOf(end.toString());
                        date = line.substring(beginIndex, endIndex);
                        step=2;
                        break;
                    case 2:
                        beginIndex = line.indexOf(start.toString()) + start.length();
                        endIndex = line.indexOf(end.toString());
                        grade = line.substring(beginIndex, endIndex);
                        step=3;
                        break;
                    case 3:
                        beginIndex = line.indexOf(start.toString()) + start.length();
                        endIndex = line.indexOf(end.toString());
                        hours = line.substring(beginIndex, endIndex);
                        step=4;
                        break;
                    case 4:
                        beginIndex = line.indexOf(start.toString()) + start.length();
                        endIndex = line.indexOf(end.toString());
                        subject = line.substring(beginIndex, endIndex);
                        step=5;
                        break;
                    case 5:
                        beginIndex = line.indexOf(start.toString()) + start.length();
                        endIndex = line.indexOf(end.toString());
                        room = line.substring(beginIndex, endIndex);
                        step=6;
                        break;
                    case 6:
                        beginIndex = line.indexOf(start.toString()) + start.length();
                        endIndex = line.indexOf(end.toString());
                        oldSubject = line.substring(beginIndex, endIndex);
                        step=7;
                        break;
                    case 7:
                        beginIndex = line.indexOf(start.toString()) + start.length();
                        endIndex = line.indexOf(end.toString());
                        text = line.substring(beginIndex, endIndex);
                        step=8;
                        break;
                }
            }
            if(line.contains("<tr class=\"list odd\">")||line.contains("<tr class=\"list even\">")){
                inTable=true;
                step=1;
            }
            if(line.contains("</tr>"))inTable=false;
        }
    }catch(IOException e){
        e.printStackTrace();
    }
}


@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.menu_main, menu);
    return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    //noinspection SimplifiableIfStatement
    if (id == R.id.action_settings) {
        return true;
    }

    return super.onOptionsItemSelected(item);
}
public void getGrade(){
    switch(defaultGrade){
        case "01":
            defaultGrade="5a";
            break;
        case "02":
            defaultGrade="5b";
            break;
        case "03":
            defaultGrade="5c";
            break;
        case "04":
            defaultGrade="5d";
            break;
        case "05":
            defaultGrade="6a";
            break;
        case "06":
            defaultGrade="6b";
            break;
        case "07":
            defaultGrade="6c";
            break;
        case "08":
            defaultGrade="6d";
            break;
        case "09":
            defaultGrade="7a";
            break;
        case "10":
            defaultGrade="7b";
            break;
        case "11":
            defaultGrade="7c";
            break;
        case "12":
            defaultGrade="7d";
            break;
        case "13":
            defaultGrade="7e";
            break;
        case "14":
            defaultGrade="8a";
            break;
        case "15":
            defaultGrade="8b";
            break;
        case "16":
            defaultGrade="8c";
            break;
        case "17":
            defaultGrade="8d";
            break;
        case "18":
            defaultGrade="8e";
            break;
        case "19":
            defaultGrade="9a";
            break;
        case "20":
            defaultGrade="9b";
            break;
        case "21":
            defaultGrade="9c";
            break;
        case "22":
            defaultGrade="9d";
            break;
        case "23":
            defaultGrade="9e";
            break;
        case "24":
            defaultGrade="10a";
            break;
        case "25":
            defaultGrade="10b";
            break;
        case "26":
            defaultGrade="10c";
            break;
        case "27":
            defaultGrade="10d";
            break;
        case "28":
            defaultGrade="11";
            break;
        case "29":
            defaultGrade="12";
            break;
    }
}

      

} `

0


source to share





All Articles