Results 1 to 17 of 17
Like Tree1Likes
  • 1 Post By Norm

Thread: trouble reading text from url

  1. #1
    mdehghani is offline Member
    Join Date
    Jan 2017
    Posts
    9
    Rep Power
    0

    Default trouble reading text from url

    hi everybody. i'm struggling to read a text from url but i get an empty string every time. it looks very strange because i can read text from other urls using same code but get an empty string everytime i try this url. my code structure is like below and the troublesome url is :
    http://www.dadhesab.ir/services/GetLatestMonth






    Java Code:
    package ir.dadhesab.dadhesab;
    
    import android.app.AlertDialog;
    import android.content.Context;
    import android.content.DialogInterface;
    import android.content.Intent;
    import android.graphics.Color;
    import android.graphics.Typeface;
    import android.net.ConnectivityManager;
    import android.net.NetworkInfo;
    import android.net.Uri;
    import android.os.AsyncTask;
    import android.os.Bundle;
    import android.support.v7.app.ActionBar;
    import android.support.v7.app.AppCompatActivity;
    import android.support.v7.widget.Toolbar;
    import android.util.DisplayMetrics;
    import android.view.Gravity;
    import android.view.View;
    import android.view.ViewGroup;
    import android.view.WindowManager;
    import android.view.inputmethod.InputMethodManager;
    import android.widget.AdapterView;
    import android.widget.ArrayAdapter;
    import android.widget.Button;
    import android.widget.EditText;
    import android.widget.LinearLayout;
    import android.widget.Spinner;
    import android.widget.TextView;
    
    import com.crashlytics.android.Crashlytics;
    import com.crashlytics.android.answers.Answers;
    import com.google.android.gms.analytics.HitBuilders;
    import com.google.android.gms.analytics.Tracker;
    import com.google.firebase.analytics.FirebaseAnalytics;
    
    
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.lang.ref.SoftReference;
    import java.lang.reflect.Type;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Collections;
    import java.util.HashMap;
    import java.util.LinkedHashMap;
    import java.util.List;
    import java.util.Map;
    
    import io.fabric.sdk.android.Fabric;
    
    public class LatePaymentDamageActivity extends AppCompatActivity {
    
        final Context context = this;
       
        TextView resultTextView;
        private EditText editText;
        private Spinner calculationmethodspinner;
        
    
        private static final String[] calculationMethodsArray = new String[] { "سالانه",
                "ماهانه"};
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_late_payment_damage);
           
        }
    
        public void calculate(View view) {
    
            calculationmethodspinner = (Spinner) findViewById(R.id.calculationmethodspinner);
            editText = (EditText) findViewById(R.id.editText);
           
            resultTextView = (TextView) findViewById(R.id.resulttextView);
    
            if (calculationmethodspinner.getSelectedItem().toString().equals("سالانه")) {
    
                
    
            }
            if (calculationmethodspinner.getSelectedItem().toString().equals("ماهانه")) {
    
                String paymentmonth = "";
                String duemonth = "";
    
                paymentmonth = "139510";
                duemonth = "139205";
    
                    final ConnectivityManager conMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
                    final NetworkInfo activeNetwork = conMgr.getActiveNetworkInfo();
                    if (activeNetwork != null && activeNetwork.isConnected()) {
                        try {
                            // Create a URL for the desired page
                            URL url = new URL("http://www.dadhesab.ir/services/GetLatestMonth");
    
                            // launch task
                            new LatePaymentDamageActivity.ReadTextTask().execute(url);
                        }
                        catch (MalformedURLException e) {
                            // ** do something here **
                    e.printStackTrace();
    
                        }
    
                    } else {
                        resultTextView.setText("خطا : اتصال به اینترنت برقرار نمی باشد.");
                    }
            }
    
        }
        private class ReadTextTask extends AsyncTask<URL, Void, String> {
            String latestvc;
    
            @Override
            protected String doInBackground(URL... urls) {
    
                try {
                    // Read all the text returned by the server
                    BufferedReader in = new BufferedReader(new InputStreamReader(urls[0].openStream()));
                    latestvc = in.readLine();
                    in.close();
                }
                catch (IOException e) {
                    // ** do something here **
                    e.printStackTrace();
    
                }
                return latestvc;
            }
    
            @Override
            protected void onPostExecute(String result) {
                int versionCode = BuildConfig.VERSION_CODE;
                
                try
                {
                    resultTextView.setText(latestvc);
                }
                catch (Throwable e){   
                    e.printStackTrace();
                }
    
            }
        }
    
    }
    Last edited by mdehghani; 01-11-2017 at 10:51 PM. Reason: add code tags

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,239
    Rep Power
    23

    Default Re: trouble reading text from url

    When posting code please wrap it in code tags.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,239
    Rep Power
    23

    Default Re: trouble reading text from url

    OK.
    Are those catch blocks for your IOExcpetions really empty?
    If so, how will you ever know whether an exception was thrown?
    At the least you should be doing e.printStackTrace().
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  4. #4
    mdehghani is offline Member
    Join Date
    Jan 2017
    Posts
    9
    Rep Power
    0

    Default Re: trouble reading text from url

    Quote Originally Posted by Tolls View Post
    OK.
    Are those catch blocks for your IOExcpetions really empty?
    If so, how will you ever know whether an exception was thrown?
    At the least you should be doing e.printStackTrace().
    thanks for the advice. but the main question remains

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,239
    Rep Power
    23

    Default Re: trouble reading text from url

    Well, if those catch blocks are empty then you don't know if an exception is thrown.
    So stick something in there so we can rule that out.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  6. #6
    mdehghani is offline Member
    Join Date
    Jan 2017
    Posts
    9
    Rep Power
    0

    Default Re: trouble reading text from url

    Quote Originally Posted by Tolls View Post
    Well, if those catch blocks are empty then you don't know if an exception is thrown.
    So stick something in there so we can rule that out.
    i made some change to the code so that there is only one attempt to read from that mysterious url and completed the code blocks as you mentioned. still no sign of text recognition. and the log cat is as follows:

    01-12 00:23:42.890 26885-26885/? D/dalvikvm: Late-enabling CheckJNI
    01-12 00:23:42.900 26885-26891/? I/jdwp: Ignoring second debugger -- accepting and dropping
    01-12 00:23:43.011 26885-26885/ir.dadhesab.dadhesab D/ActivityThread: setTargetHeapUtilization:0.25
    01-12 00:23:43.011 26885-26885/ir.dadhesab.dadhesab D/ActivityThread: setTargetHeapConcurrentStart:2097152
    01-12 00:23:43.011 26885-26885/ir.dadhesab.dadhesab D/HyLog: I : /data/font/config/dfactpre.dat, No such file or directory (2)
    01-12 00:23:43.151 26885-26885/ir.dadhesab.dadhesab I/InstantRun: Instant Run Runtime started. Android package is ir.dadhesab.dadhesab, real application class is ir.dadhesab.dadhesab.AnalyticsApplication.
    01-12 00:23:43.161 26885-26885/ir.dadhesab.dadhesab W/InstantRun: No instant run dex files added to classpath
    01-12 00:23:43.181 26885-26885/ir.dadhesab.dadhesab I/dalvikvm: Could not find method android.content.pm.PackageManager.getPackageInstal ler, referenced from method com.google.android.gms.common.zze.zzs
    01-12 00:23:43.181 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve virtual method 798: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
    01-12 00:23:43.181 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x6e at 0x0013
    01-12 00:23:43.191 26885-26902/ir.dadhesab.dadhesab W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
    01-12 00:23:43.191 26885-26902/ir.dadhesab.dadhesab W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
    01-12 00:23:43.201 26885-26885/ir.dadhesab.dadhesab I/dalvikvm: Could not find method android.content.Context.getNoBackupFilesDir, referenced from method com.google.android.gms.common.util.zzw.getNoBackup FilesDir
    01-12 00:23:43.201 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve virtual method 558: Landroid/content/Context;.getNoBackupFilesDir ()Ljava/io/File;
    01-12 00:23:43.201 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
    01-12 00:23:43.401 26885-26885/ir.dadhesab.dadhesab I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:0
    01-12 00:23:43.401 26885-26885/ir.dadhesab.dadhesab I/DynamiteModule: Selected local version of com.google.android.gms.flags
    01-12 00:23:43.411 26885-26885/ir.dadhesab.dadhesab W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
    01-12 00:23:43.411 26885-26885/ir.dadhesab.dadhesab I/DynamiteModule: Considering local module com.google.android.gms.crash:0 and remote module com.google.android.gms.crash:4
    01-12 00:23:43.411 26885-26885/ir.dadhesab.dadhesab I/DynamiteModule: Selected remote version of com.google.android.gms.crash, version >= 4
    01-12 00:23:43.421 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: DexOpt: couldn't find static field Landroid/os/Build;.SUPPORTED_64_BIT_ABIS
    01-12 00:23:43.421 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve static field 27 (SUPPORTED_64_BIT_ABIS) in Landroid/os/Build;
    01-12 00:23:43.421 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x62 at 0x0012
    01-12 00:23:43.421 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: DexOpt: couldn't find static field Landroid/os/Build;.SUPPORTED_32_BIT_ABIS
    01-12 00:23:43.421 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve static field 26 (SUPPORTED_32_BIT_ABIS) in Landroid/os/Build;
    01-12 00:23:43.421 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x62 at 0x0021
    01-12 00:23:43.421 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: DexOpt: couldn't find static field Landroid/os/Build;.SUPPORTED_64_BIT_ABIS
    01-12 00:23:43.421 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve static field 27 (SUPPORTED_64_BIT_ABIS) in Landroid/os/Build;
    01-12 00:23:43.421 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x62 at 0x0008
    01-12 00:23:43.421 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: DexOpt: couldn't find static field Landroid/os/Build;.SUPPORTED_64_BIT_ABIS
    01-12 00:23:43.421 26885-26885/ir.dadhesab.dadhesab I/dalvikvm: DexOpt: unable to optimize static field ref 0x001b at 0x17 in Ls;.a
    01-12 00:23:43.421 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: DexOpt: couldn't find static field Landroid/os/Build;.SUPPORTED_32_BIT_ABIS
    01-12 00:23:43.421 26885-26885/ir.dadhesab.dadhesab I/dalvikvm: DexOpt: unable to optimize static field ref 0x001a at 0x26 in Ls;.a
    01-12 00:23:43.421 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: DexOpt: couldn't find static field Landroid/os/Build;.SUPPORTED_64_BIT_ABIS
    01-12 00:23:43.421 26885-26885/ir.dadhesab.dadhesab I/dalvikvm: DexOpt: unable to optimize static field ref 0x001b at 0x0d in Ls;.b
    01-12 00:23:43.461 26885-26885/ir.dadhesab.dadhesab I/dalvikvm: Could not find method android.content.ContextWrapper.createCredentialPro tectedStorageContext, referenced from method b.createCredentialProtectedStorageContext
    01-12 00:23:43.461 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve virtual method 56: Landroid/content/ContextWrapper;.createCredentialProtectedStorageCo ntext ()Landroid/content/Context;
    01-12 00:23:43.461 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x6f at 0x0002
    01-12 00:23:43.461 26885-26885/ir.dadhesab.dadhesab I/dalvikvm: Could not find method android.content.ContextWrapper.createDeviceProtect edStorageContext, referenced from method b.createDeviceProtectedStorageContext
    01-12 00:23:43.461 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve virtual method 57: Landroid/content/ContextWrapper;.createDeviceProtectedStorageContex t ()Landroid/content/Context;
    01-12 00:23:43.461 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x6f at 0x0002
    01-12 00:23:43.461 26885-26885/ir.dadhesab.dadhesab I/FirebaseCrashApiImpl: FirebaseCrashApiImpl created by ClassLoader m[DexPathList[[zip file "/data/data/com.google.android.gms/app_chimera/m/00000012/DynamiteModulesC_GmsCore_prod_xxhdpi_release.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]]
    01-12 00:23:43.501 26885-26885/ir.dadhesab.dadhesab I/DynamiteModule: Considering local module com.google.android.gms.flags:2 and remote module com.google.android.gms.flags:0
    01-12 00:23:43.501 26885-26885/ir.dadhesab.dadhesab I/DynamiteModule: Selected local version of com.google.android.gms.flags
    01-12 00:23:43.511 26885-26885/ir.dadhesab.dadhesab I/dalvikvm: Could not find method java.util.Locale.toLanguageTag, referenced from method bnw.y
    01-12 00:23:43.511 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve virtual method 10289: Ljava/util/Locale;.toLanguageTag ()Ljava/lang/String;
    01-12 00:23:43.511 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x6e at 0x0013
    01-12 00:23:43.511 26885-26885/ir.dadhesab.dadhesab I/ContextImpl: getDeclaredConstructor
    01-12 00:23:43.511 26885-26885/ir.dadhesab.dadhesab W/DynamiteModule: Local module descriptor class for com.google.android.gms.crash not found.
    01-12 00:23:43.511 26885-26885/ir.dadhesab.dadhesab I/dalvikvm: Could not find method android.content.pm.PackageManager.getPackageInstal ler, referenced from method ajb.a
    01-12 00:23:43.511 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve virtual method 2355: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
    01-12 00:23:43.511 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x6e at 0x001c
    01-12 00:23:43.521 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: DexOpt: couldn't find static field Lvd;.common_full_open_on_phone
    01-12 00:23:43.521 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve static field 4824 (common_full_open_on_phone) in Lvd;
    01-12 00:23:43.521 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x60 at 0x0060
    01-12 00:23:43.521 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: DexOpt: couldn't find static field Lvf;.common_google_play_services_notification_tick er
    01-12 00:23:43.521 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve static field 4834 (common_google_play_services_notification_ticker) in Lvf;
    01-12 00:23:43.521 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x60 at 0x0092
    01-12 00:23:43.521 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: DexOpt: couldn't find static field Lvf;.common_open_on_phone
    01-12 00:23:43.521 26885-26885/ir.dadhesab.dadhesab I/dalvikvm: DexOpt: unable to optimize static field ref 0x12e9 at 0x62 in Laio;.a
    01-12 00:23:43.541 26885-26885/ir.dadhesab.dadhesab W/BaseRuntimeLoader: don't searchcom.lge.telephony.msim.QcomMSimTelephonyMana gerAdaptor class
    01-12 00:23:43.541 26885-26885/ir.dadhesab.dadhesab W/BaseRuntimeLoader: don't searchcom.lge.telephony.msim.MtkMSimTelephonyManag erAdaptor class
    01-12 00:23:43.541 26885-26885/ir.dadhesab.dadhesab W/BaseRuntimeLoader: don't searchcom.lge.telephony.msim.QcomMSimTelephonyMana gerAdaptor class
    01-12 00:23:43.541 26885-26885/ir.dadhesab.dadhesab W/BaseRuntimeLoader: don't searchcom.lge.telephony.msim.MtkMSimTelephonyManag erAdaptor class
    01-12 00:23:43.551 26885-26885/ir.dadhesab.dadhesab I/FA: App measurement is starting up, version: 10084
    01-12 00:23:43.551 26885-26885/ir.dadhesab.dadhesab I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
    01-12 00:23:43.551 26885-26885/ir.dadhesab.dadhesab D/FA: Debug-level message logging enabled
    01-12 00:23:43.551 26885-26885/ir.dadhesab.dadhesab D/FA: AppMeasurement singleton hash: 1117427128
    01-12 00:23:43.571 26885-26885/ir.dadhesab.dadhesab V/FA: Collection enabled
    01-12 00:23:43.571 26885-26885/ir.dadhesab.dadhesab V/FA: App package, google app id: ir.dadhesab.dadhesab, 1:444738136300:android:308225dbed299a16
    01-12 00:23:43.571 26885-26885/ir.dadhesab.dadhesab I/FA: To enable faster debug mode event logging run:
    adb shell setprop debug.firebase.analytics.app ir.dadhesab.dadhesab
    01-12 00:23:43.591 26885-26885/ir.dadhesab.dadhesab V/FA: Registered activity lifecycle callback
    01-12 00:23:43.591 26885-26885/ir.dadhesab.dadhesab I/FirebaseCrash: FirebaseCrash reporting initialized com.google.android.gms.internal.zzbks@42936c38
    01-12 00:23:43.591 26885-26885/ir.dadhesab.dadhesab I/FirebaseInitProvider: FirebaseApp initialization successful
    01-12 00:23:43.591 26885-26946/ir.dadhesab.dadhesab V/FA: Using measurement service
    01-12 00:23:43.591 26885-26946/ir.dadhesab.dadhesab V/FA: Connecting to remote service
    01-12 00:23:43.611 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/view/SearchEvent;)
    01-12 00:23:43.611 26885-26885/ir.dadhesab.dadhesab I/dalvikvm: Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.view.WindowCallbackWrapper.onSe archRequested
    01-12 00:23:43.611 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve interface method 16536: Landroid/view/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z
    01-12 00:23:43.611 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
    01-12 00:23:43.611 26885-26885/ir.dadhesab.dadhesab I/dalvikvm: Could not find method android.view.Window$Callback.onWindowStartingActio nMode, referenced from method android.support.v7.view.WindowCallbackWrapper.onWi ndowStartingActionMode
    01-12 00:23:43.611 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve interface method 16540: Landroid/view/Window$Callback;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
    01-12 00:23:43.611 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002
    01-12 00:23:43.621 26885-26885/ir.dadhesab.dadhesab V/FA: onActivityCreated
    01-12 00:23:43.661 26885-26885/ir.dadhesab.dadhesab I/ActivityManager: Timeline: Activity_launch_request id:ir.dadhesab.dadhesab time:346644762
    01-12 00:23:43.691 26885-26885/ir.dadhesab.dadhesab V/FA: onActivityCreated
    01-12 00:23:43.801 26885-26885/ir.dadhesab.dadhesab I/CrashlyticsCore: Initializing Crashlytics 2.3.14.151
    01-12 00:23:43.911 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: GC_FOR_ALLOC freed 1995K, 30% free 17495K/24840K, paused 31ms, total 31ms
    01-12 00:23:43.941 26885-26885/ir.dadhesab.dadhesab I/dalvikvm-heap: Grow heap (frag case) to 32.714MB for 14107552-byte allocation
    01-12 00:23:43.961 26885-26885/ir.dadhesab.dadhesab I/dalvikvm: Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.widget.ResourcesWrapper.getDraw able
    01-12 00:23:43.961 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve virtual method 842: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
    01-12 00:23:43.961 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
    01-12 00:23:43.961 26885-26885/ir.dadhesab.dadhesab I/dalvikvm: Could not find method android.content.res.Resources.getDrawableForDensit y, referenced from method android.support.v7.widget.ResourcesWrapper.getDraw ableForDensity
    01-12 00:23:43.961 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve virtual method 844: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
    01-12 00:23:43.961 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
    01-12 00:23:43.991 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: GC_FOR_ALLOC freed 115K, 20% free 31167K/38620K, paused 24ms, total 24ms
    01-12 00:23:44.011 26885-26885/ir.dadhesab.dadhesab I/dalvikvm: Could not find method android.content.res.TypedArray.getChangingConfigur ations, referenced from method android.support.v7.widget.TintTypedArray.getChangi ngConfigurations
    01-12 00:23:44.011 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve virtual method 879: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
    01-12 00:23:44.011 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
    01-12 00:23:44.011 26885-26885/ir.dadhesab.dadhesab I/dalvikvm: Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType
    01-12 00:23:44.011 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve virtual method 901: Landroid/content/res/TypedArray;.getType (I)I
    01-12 00:23:44.011 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002
    01-12 00:23:44.042 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: GC_FOR_ALLOC freed 10K, 12% free 34339K/38620K, paused 22ms, total 22ms
    01-12 00:23:44.092 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: GC_FOR_ALLOC freed <1K, 7% free 39088K/41788K, paused 23ms, total 23ms
    01-12 00:23:44.182 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: GC_FOR_ALLOC freed 14K, 6% free 44566K/47252K, paused 24ms, total 24ms
    01-12 00:23:44.392 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: GC_FOR_ALLOC freed 30K, 6% free 46994K/49548K, paused 23ms, total 38ms
    01-12 00:23:44.412 26885-26885/ir.dadhesab.dadhesab I/dalvikvm-heap: Grow heap (frag case) to 53.951MB for 6169192-byte allocation
    01-12 00:23:44.462 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: GC_FOR_ALLOC freed 4K, 5% free 53019K/55576K, paused 24ms, total 24ms
    01-12 00:23:44.562 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: GC_FOR_ALLOC freed 1K, 5% free 54613K/57160K, paused 24ms, total 24ms
    01-12 00:23:44.592 26885-26885/ir.dadhesab.dadhesab I/dalvikvm-heap: Grow heap (frag case) to 67.867MB for 12960016-byte allocation
    01-12 00:23:44.642 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: GC_FOR_ALLOC freed <1K, 4% free 67270K/69820K, paused 25ms, total 25ms
    01-12 00:23:44.722 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: GC_FOR_ALLOC freed 1K, 4% free 71496K/74044K, paused 25ms, total 25ms
    01-12 00:23:44.812 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: GC_FOR_ALLOC freed 1K, 4% free 75192K/77740K, paused 30ms, total 31ms
    01-12 00:23:44.882 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: GC_FOR_ALLOC freed 1K, 4% free 78888K/81436K, paused 36ms, total 36ms
    01-12 00:23:44.942 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: GC_FOR_ALLOC freed 5K, 3% free 82583K/85132K, paused 30ms, total 30ms
    01-12 00:23:45.002 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: GC_FOR_ALLOC freed <1K, 3% free 86279K/88828K, paused 26ms, total 26ms
    01-12 00:23:45.063 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: GC_FOR_ALLOC freed <1K, 3% free 89974K/92524K, paused 29ms, total 29ms
    01-12 00:23:45.143 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: GC_FOR_ALLOC freed 1K, 3% free 94799K/97348K, paused 27ms, total 27ms
    01-12 00:23:45.163 26885-26885/ir.dadhesab.dadhesab I/dalvikvm-heap: Grow heap (frag case) to 100.998MB for 6548488-byte allocation
    01-12 00:23:45.203 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: GC_FOR_ALLOC freed <1K, 3% free 101197K/103744K, paused 24ms, total 24ms
    01-12 00:23:45.243 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: GC_FOR_ALLOC freed <1K, 3% free 102327K/104872K, paused 20ms, total 20ms
    01-12 00:23:45.253 26885-26885/ir.dadhesab.dadhesab I/dalvikvm-heap: Grow heap (frag case) to 108.349MB for 6548488-byte allocation
    01-12 00:23:45.413 26885-26885/ir.dadhesab.dadhesab V/WebViewChromium: Binding Chromium to the background looper Looper (main, tid 1) {42843650}
    01-12 00:23:45.413 26885-26885/ir.dadhesab.dadhesab I/chromium: [INFO:library_loader_hooks.cc(112)] Chromium logging enabled: level = 0, default verbosity = 0
    01-12 00:23:45.423 26885-26885/ir.dadhesab.dadhesab I/BrowserProcessMain: Initializing chromium process, renderers=0
    01-12 00:23:45.463 26885-27073/ir.dadhesab.dadhesab W/chromium: [WARNING:proxy_service.cc(888)] PAC support disabled because there is no system implementation
    01-12 00:23:45.473 26885-26885/ir.dadhesab.dadhesab I/Adreno-EGL: <qeglDrvAPI_eglInitialize:381>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_KK_2.7_RB1.04.04.02.007.040_msm89 60_KK_2.7_RB1_CL3869936_release_AU (CL3869936)
    OpenGL ES Shader Compiler Version: 17.01.12.SPL
    Build Date: 02/24/14 Mon
    Local Branch:
    Remote Branch: quic/kk_2.7_rb1.28
    Local Patches: NONE
    Reconstruct Branch: AU_LINUX_ANDROID_KK_2.7_RB1.04.04.02.007.040 + adff0e1 + fed91a3 + f6acee5 + 7174af8 + e088f4b + NOTHING
    01-12 00:23:45.943 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: GC_FOR_ALLOC freed 22K, 3% free 108770K/111268K, paused 31ms, total 31ms
    01-12 00:23:46.003 26885-26885/ir.dadhesab.dadhesab I/GAv4: Google Analytics 10.0.84 is starting up. To enable debug logging on a device run:
    adb shell setprop log.tag.GAv4 DEBUG
    adb logcat -s GAv4
    01-12 00:23:46.023 26885-27107/ir.dadhesab.dadhesab W/GAv4: AnalyticsReceiver is not registered or is disabled. Register the receiver for reliable dispatching on non-Google Play devices. See http://goo.gl/8Rd3yj for instructions.
    01-12 00:23:46.023 26885-26885/ir.dadhesab.dadhesab I/dadhesab: initService()
    01-12 00:23:46.033 26885-27107/ir.dadhesab.dadhesab W/GAv4: CampaignTrackingReceiver is not registered, not exported or is disabled. Installation campaign tracking is not possible. See http://goo.gl/8Rd3yj for instructions.
    01-12 00:23:46.033 26885-26885/ir.dadhesab.dadhesab E/dadhesab: initService() bound value: true
    01-12 00:23:46.033 26885-27107/ir.dadhesab.dadhesab W/GAv4: AnalyticsService not registered in the app manifest. Hits might not be delivered reliably. See http://goo.gl/8Rd3yj for instructions.
    01-12 00:23:46.224 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: Note: class Lcom/lge/mdm/manager/ILGMDMDevicePolicyManager$Stub; has 348 unimplemented (abstract) methods
    01-12 00:23:46.364 26885-26885/ir.dadhesab.dadhesab D/dadhesab: Loaded data: tank = 4
    01-12 00:23:46.364 26885-26885/ir.dadhesab.dadhesab D/dadhesab: Creating IAB helper.
    01-12 00:23:46.364 26885-26885/ir.dadhesab.dadhesab D/dadhesab: Starting setup.
    01-12 00:23:46.374 26885-26946/ir.dadhesab.dadhesab V/FA: Using measurement service
    01-12 00:23:46.374 26885-26946/ir.dadhesab.dadhesab V/FA: Connection attempt already in progress
    01-12 00:23:46.384 26885-26946/ir.dadhesab.dadhesab V/FA: Activity resumed, time: 571670530
    01-12 00:23:46.394 26885-26946/ir.dadhesab.dadhesab D/FA: Connected to remote service
    01-12 00:23:46.394 26885-26946/ir.dadhesab.dadhesab V/FA: Processing queued up service tasks: 2
    01-12 00:23:46.404 26885-26885/ir.dadhesab.dadhesab E/LoginCheck: onServiceConnected(): Connected
    01-12 00:23:46.464 26885-27118/ir.dadhesab.dadhesab E/DataScheduler: isDataSchedulerEnabled():false
    01-12 00:23:46.554 26885-26885/ir.dadhesab.dadhesab D/OpenGLRenderer: Enabling debug mode 0
    01-12 00:23:46.604 26885-26885/ir.dadhesab.dadhesab D/dadhesab: Setup successful. Querying inventory.
    01-12 00:23:47.135 26885-26885/ir.dadhesab.dadhesab I/Choreographer: Skipped 30 frames! The application may be doing too much work on its main thread.
    01-12 00:23:47.225 26885-26885/ir.dadhesab.dadhesab I/ActivityManager: Timeline: Activity_idle id: android.os.BinderProxy@42a11fb0 time:346648325
    01-12 00:23:48.526 26885-26885/ir.dadhesab.dadhesab I/chromium: [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
    01-12 00:23:48.556 26885-26885/ir.dadhesab.dadhesab I/chromium: [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
    01-12 00:23:48.566 26885-26885/ir.dadhesab.dadhesab E/qdutils: FBIOGET_FSCREENINFO failed
    01-12 00:23:48.676 26885-26885/ir.dadhesab.dadhesab D/dadhesab: Query inventory finished.
    01-12 00:23:48.676 26885-26885/ir.dadhesab.dadhesab D/dadhesab: Query inventory was successful.
    01-12 00:23:48.676 26885-26885/ir.dadhesab.dadhesab D/dadhesab: User HAS infinite gas subscription.
    01-12 00:23:48.676 26885-26885/ir.dadhesab.dadhesab D/dadhesab: Saved data: tank = 4
    01-12 00:23:48.676 26885-26885/ir.dadhesab.dadhesab D/dadhesab: Initial inventory query finished; enabling main UI.
    01-12 00:23:51.539 26885-26946/ir.dadhesab.dadhesab V/FA: Inactivity, disconnecting from the service
    01-12 00:23:53.721 26885-26902/ir.dadhesab.dadhesab W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.
    01-12 00:23:58.976 26885-26885/ir.dadhesab.dadhesab I/ViewRootImpl: ViewRoot's Touch Event : ACTION_DOWN
    01-12 00:23:59.266 26885-26885/ir.dadhesab.dadhesab I/ViewRootImpl: ViewRoot's Touch Event : ACTION_UP
    01-12 00:23:59.777 26885-26885/ir.dadhesab.dadhesab I/ViewRootImpl: ViewRoot's Touch Event : ACTION_DOWN
    01-12 00:23:59.827 26885-26885/ir.dadhesab.dadhesab I/ActivityManager: Timeline: Activity_launch_request id:ir.dadhesab.dadhesab time:346660926
    01-12 00:23:59.827 26885-26885/ir.dadhesab.dadhesab I/ViewRootImpl: ViewRoot's Touch Event : ACTION_UP
    01-12 00:23:59.847 26885-26946/ir.dadhesab.dadhesab V/FA: Recording user engagement, ms: 13467
    01-12 00:23:59.847 26885-26946/ir.dadhesab.dadhesab V/FA: Using measurement service
    01-12 00:23:59.847 26885-26946/ir.dadhesab.dadhesab V/FA: Connecting to remote service
    01-12 00:23:59.877 26885-26946/ir.dadhesab.dadhesab V/FA: Activity paused, time: 571683997
    01-12 00:23:59.887 26885-26946/ir.dadhesab.dadhesab I/FA: Tag Manager is not found and thus will not be used
    01-12 00:23:59.897 26885-26946/ir.dadhesab.dadhesab D/FA: Logging event (FE): _e, Bundle[{_o=auto, _et=13467, _sc=MainActivity, _si=4487654666636612172}]
    01-12 00:23:59.897 26885-26885/ir.dadhesab.dadhesab V/FA: onActivityCreated
    01-12 00:23:59.917 26885-26946/ir.dadhesab.dadhesab V/FA: Using measurement service
    01-12 00:23:59.917 26885-26946/ir.dadhesab.dadhesab V/FA: Connection attempt already in progress
    01-12 00:23:59.927 26885-26885/ir.dadhesab.dadhesab I/dalvikvm: Could not find method android.widget.Spinner.getPopupContext, referenced from method android.support.v7.widget.AppCompatSpinner.getPopu pContext
    01-12 00:23:59.927 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve virtual method 17398: Landroid/widget/Spinner;.getPopupContext ()Landroid/content/Context;
    01-12 00:23:59.927 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x6f at 0x000b
    01-12 00:24:00.027 26885-26885/ir.dadhesab.dadhesab E/dalvikvm: Could not find class 'android.widget.ThemedSpinnerAdapter', referenced from method android.support.v7.widget.AppCompatSpinner$DropDow nAdapter.<init>
    01-12 00:24:00.027 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve instanceof 2145 (Landroid/widget/ThemedSpinnerAdapter;) in Landroid/support/v7/widget/AppCompatSpinner$DropDownAdapter;
    01-12 00:24:00.027 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x20 at 0x0016
    01-12 00:24:00.037 26885-26946/ir.dadhesab.dadhesab V/FA: Using measurement service
    01-12 00:24:00.037 26885-26946/ir.dadhesab.dadhesab V/FA: Connection attempt already in progress
    01-12 00:24:00.037 26885-26885/ir.dadhesab.dadhesab D/BubblePopupHelper: isShowingBubblePopup : false
    01-12 00:24:00.037 26885-26946/ir.dadhesab.dadhesab V/FA: Activity resumed, time: 571684190
    01-12 00:24:00.117 26885-26885/ir.dadhesab.dadhesab D/BubblePopupHelper: isShowingBubblePopup : false
    01-12 00:24:00.117 26885-26885/ir.dadhesab.dadhesab D/BubblePopupHelper: isShowingBubblePopup : false
    01-12 00:24:00.117 26885-26946/ir.dadhesab.dadhesab D/FA: Connected to remote service
    01-12 00:24:00.117 26885-26946/ir.dadhesab.dadhesab V/FA: Processing queued up service tasks: 3
    01-12 00:24:00.247 26885-26885/ir.dadhesab.dadhesab D/cliptray_Editor: setInputTypeforClipTray(): 0
    01-12 00:24:00.287 26885-26885/ir.dadhesab.dadhesab D/BubblePopupHelper: isShowingBubblePopup : false
    01-12 00:24:00.287 26885-26885/ir.dadhesab.dadhesab D/BubblePopupHelper: isShowingBubblePopup : false
    01-12 00:24:00.347 26885-26885/ir.dadhesab.dadhesab I/ActivityManager: Timeline: Activity_idle id: android.os.BinderProxy@42a6a938 time:346661440
    01-12 00:24:02.069 26885-26885/ir.dadhesab.dadhesab I/ViewRootImpl: ViewRoot's Touch Event : ACTION_DOWN
    01-12 00:24:02.139 26885-26885/ir.dadhesab.dadhesab I/ViewRootImpl: ViewRoot's Touch Event : ACTION_UP
    01-12 00:24:02.149 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: method Landroid/support/v7/widget/ListViewCompat;.lookForSelectablePosition incorrectly overrides package-private method with same name in Landroid/widget/ListView;
    01-12 00:24:02.159 26885-26885/ir.dadhesab.dadhesab I/dalvikvm: Could not find method android.support.v7.widget.ListPopupWindow$DropDown ListView.drawableHotspotChanged, referenced from method android.support.v7.widget.ListPopupWindow$DropDown ListView.setPressedItem
    01-12 00:24:02.159 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve virtual method 14774: Landroid/support/v7/widget/ListPopupWindow$DropDownListView;.drawableHotspotC hanged (FF)V
    01-12 00:24:02.159 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x6e at 0x000a
    01-12 00:24:02.159 26885-26885/ir.dadhesab.dadhesab I/dalvikvm: Could not find method android.view.View.drawableHotspotChanged, referenced from method android.support.v7.widget.ListPopupWindow$DropDown ListView.setPressedItem
    01-12 00:24:02.159 26885-26885/ir.dadhesab.dadhesab W/dalvikvm: VFY: unable to resolve virtual method 16152: Landroid/view/View;.drawableHotspotChanged (FF)V
    01-12 00:24:02.159 26885-26885/ir.dadhesab.dadhesab D/dalvikvm: VFY: replacing opcode 0x6e at 0x004a
    01-12 00:24:02.780 26885-26885/ir.dadhesab.dadhesab I/ViewRootImpl: ViewRoot's Touch Event : ACTION_DOWN
    01-12 00:24:02.850 26885-26885/ir.dadhesab.dadhesab I/ViewRootImpl: ViewRoot's Touch Event : ACTION_UP
    01-12 00:24:04.882 26885-26885/ir.dadhesab.dadhesab I/ViewRootImpl: ViewRoot's Touch Event : ACTION_DOWN
    01-12 00:24:04.992 26885-26885/ir.dadhesab.dadhesab I/ViewRootImpl: ViewRoot's Touch Event : ACTION_UP
    01-12 00:24:05.132 26885-26946/ir.dadhesab.dadhesab V/FA: Inactivity, disconnecting from the service
    01-12 00:24:05.172 26885-26885/ir.dadhesab.dadhesab D/BubblePopupHelper: isShowingBubblePopup : false
    01-12 00:24:05.172 26885-26885/ir.dadhesab.dadhesab D/BubblePopupHelper: isShowingBubblePopup : false
    01-12 00:24:05.773 26885-26885/ir.dadhesab.dadhesab D/cliptray_Editor: setInputTypeforClipTray(): 0
    01-12 00:24:05.803 26885-26885/ir.dadhesab.dadhesab W/IInputConnectionWrapper: sendKeyEvent on inactive InputConnection
    01-12 00:24:05.803 26885-26885/ir.dadhesab.dadhesab D/BubblePopupHelper: isShowingBubblePopup : false
    01-12 00:24:05.803 26885-26885/ir.dadhesab.dadhesab D/BubblePopupHelper: isShowingBubblePopup : false
    01-12 00:24:06.543 26885-26885/ir.dadhesab.dadhesab D/cliptray_Editor: setInputTypeforClipTray(): 0
    01-12 00:24:06.563 26885-26885/ir.dadhesab.dadhesab D/BubblePopupHelper: isShowingBubblePopup : false
    01-12 00:24:06.563 26885-26885/ir.dadhesab.dadhesab D/BubblePopupHelper: isShowingBubblePopup : false
    01-12 00:24:06.573 26885-26885/ir.dadhesab.dadhesab W/IInputConnectionWrapper: sendKeyEvent on inactive InputConnection
    01-12 00:24:06.734 26885-26885/ir.dadhesab.dadhesab D/cliptray_Editor: setInputTypeforClipTray(): 0
    01-12 00:24:06.734 26885-26885/ir.dadhesab.dadhesab W/IInputConnectionWrapper: sendKeyEvent on inactive InputConnection
    01-12 00:24:06.734 26885-26885/ir.dadhesab.dadhesab D/BubblePopupHelper: isShowingBubblePopup : false
    01-12 00:24:06.734 26885-26885/ir.dadhesab.dadhesab D/BubblePopupHelper: isShowingBubblePopup : false
    01-12 00:24:08.265 26885-26885/ir.dadhesab.dadhesab E/View: hasTransientState decremented below 0: unmatched pair of setHasTransientState calls
    01-12 00:24:08.425 26885-26885/ir.dadhesab.dadhesab D/BubblePopupHelper: isShowingBubblePopup : false
    01-12 00:24:08.425 26885-26885/ir.dadhesab.dadhesab D/BubblePopupHelper: isShowingBubblePopup : false
    01-12 00:24:10.227 26885-26885/ir.dadhesab.dadhesab I/ViewRootImpl: ViewRoot's Touch Event : ACTION_DOWN
    01-12 00:24:10.287 26885-26885/ir.dadhesab.dadhesab I/ViewRootImpl: ViewRoot's Touch Event : ACTION_UP

  7. #7
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,624
    Rep Power
    29

    Default Re: trouble reading text from url

    get an empty string everytime i try this url
    Why do you think the server at that URL will return any value?

    Can you post a full URL that returns the values you want to see?
    Last edited by Norm; 01-11-2017 at 11:27 PM.
    If you don't understand my response, don't ignore it, ask a question.

  8. #8
    mdehghani is offline Member
    Join Date
    Jan 2017
    Posts
    9
    Rep Power
    0

    Default Re: trouble reading text from url

    Quote Originally Posted by Norm View Post
    Why do you think the server at that URL will return any value?

    Can you post a full URL that returns the values you want to see?
    it appears that every thing is right. but to my surprise the device only recognises statements in the form of json!
    for example it reads : [{"month":139509,"cpi":252.9}]
    but doesn't read : 139509
    the full url is
    http://www.dadhesab.ir/services/GetLatestMonth
    which displays json format right now and not raw numbers like before

  9. #9
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,239
    Rep Power
    23

    Default Re: trouble reading text from url

    Well, when I click on that link it returns just the month number.
    Is that not what you were expecting?

    Also, thanks for adding the logging, but I should have noticed we were in the Android forum, so those should have been using the Android logging system...never mind, though.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  10. #10
    mdehghani is offline Member
    Join Date
    Jan 2017
    Posts
    9
    Rep Power
    0

    Default Re: trouble reading text from url

    Quote Originally Posted by Tolls View Post
    Well, when I click on that link it returns just the month number.
    Is that not what you were expecting?

    Also, thanks for adding the logging, but I should have noticed we were in the Android forum, so those should have been using the Android logging system...never mind, though.
    any browser shows: 139509
    but the android device reads: ""

  11. #11
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,239
    Rep Power
    23

    Default Re: trouble reading text from url

    No.
    It displays "", but you have not confirmed what it reads.
    You need to stick some debugging logging statements at the point the URL data is read, in the doInBackground method.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  12. #12
    mdehghani is offline Member
    Join Date
    Jan 2017
    Posts
    9
    Rep Power
    0

    Default Re: trouble reading text from url

    Quote Originally Posted by Tolls View Post
    No.
    It displays "", but you have not confirmed what it reads.
    You need to stick some debugging logging statements at the point the URL data is read, in the doInBackground method.
    i have debugged. it reads ""

  13. #13
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,239
    Rep Power
    23

    Default Re: trouble reading text from url

    Seriously.
    Logging is a lot more reliable.

    If nothing else, it shows us here exactly where you checked the values.

    Have you tried the URL in a standalone bit of Java?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  14. #14
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,624
    Rep Power
    29

    Default Re: trouble reading text from url

    Make sure the code reads ALL the lines returned by the server. The posted code only reads one line which is empty. Continue reading lines until a null value is returned.
    Tolls likes this.
    If you don't understand my response, don't ignore it, ask a question.

  15. #15
    mdehghani is offline Member
    Join Date
    Jan 2017
    Posts
    9
    Rep Power
    0

    Default Re: trouble reading text from url

    Quote Originally Posted by Norm View Post
    Make sure the code reads ALL the lines returned by the server. The posted code only reads one line which is empty. Continue reading lines until a null value is returned.
    can you please show me how? i'm quite new to java

  16. #16
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,624
    Rep Power
    29

    Default Re: trouble reading text from url

    Use a loop that continues reading until a null value is returned by the readLine() method.
    It is a very common technique. Any code samples you find will show you how to do it.

    Pass this to Google:
    readline until end of file java
    If you don't understand my response, don't ignore it, ask a question.

  17. #17
    mdehghani is offline Member
    Join Date
    Jan 2017
    Posts
    9
    Rep Power
    0

    Default Re: trouble reading text from url

    Quote Originally Posted by Norm View Post
    Use a loop that continues reading until a null value is returned by the readLine() method.
    It is a very common technique. Any code samples you find will show you how to do it.

    Pass this to Google:
    readline until end of file java
    thx. this was the main reason. and this line:
    latestvc = in.readLine();

Similar Threads

  1. Replies: 1
    Last Post: 11-11-2012, 02:55 AM
  2. Trouble with reading csv into object array
    By shaunstruwig in forum New To Java
    Replies: 1
    Last Post: 06-07-2012, 03:36 PM
  3. Replies: 8
    Last Post: 07-17-2011, 02:38 PM
  4. Having trouble opening and reading a txt file
    By DBaskov in forum New To Java
    Replies: 14
    Last Post: 01-29-2011, 03:55 AM
  5. Trouble with Try Catch blocks and file reading.
    By theBurgh22 in forum New To Java
    Replies: 2
    Last Post: 11-30-2010, 02:11 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •