mirror of
https://github.com/moparisthebest/android-app
synced 2024-12-23 15:08:49 -05:00
Correction de quelques bugs avec le offline
This commit is contained in:
parent
7b0f1e2200
commit
c4636fbb25
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest package="fr.gaulupeau.apps.InThePoche"
|
||||
android:versionCode="6"
|
||||
android:versionName="1.5.3" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
android:versionCode="7"
|
||||
android:versionName="@string/version" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<uses-sdk android:minSdkVersion="8"
|
||||
android:targetSdkVersion="8" />
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
|
@ -89,6 +89,14 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/btnDone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/version"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/version"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/author"
|
||||
|
@ -23,4 +23,5 @@
|
||||
<string name="txtGlobalToken"><b><u>API global token :</u></b></string>
|
||||
<string name="txtAPIUsername"><b><u>Your username ID (user_id in Feed URL):</u></b></string>
|
||||
<string name="txtAPIToken"><b><u>Your token (token in Feed URL):</u></b></string>
|
||||
<string name="version">1.5.3.1</string>
|
||||
</resources>
|
||||
|
@ -352,9 +352,19 @@ import static fr.gaulupeau.apps.Poche.ArticlesSQLiteOpenHelper.ARTICLE_SYNC;
|
||||
// Set the url (you will need to change this to your RSS URL
|
||||
url = new URL(pocheUrl + "/?feed&type=home&user_id=" + apiUsername + "&token=" + apiToken );
|
||||
// Setup the connection
|
||||
trustEveryone();
|
||||
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
|
||||
if (conn.getResponseCode() == HttpURLConnection.HTTP_OK)
|
||||
HttpsURLConnection conn_s = null;
|
||||
HttpURLConnection conn = null;
|
||||
if (pocheUrl.startsWith("https") ) {
|
||||
trustEveryone();
|
||||
conn_s = (HttpsURLConnection) url.openConnection();
|
||||
}else{
|
||||
conn = (HttpURLConnection) url.openConnection();
|
||||
}
|
||||
|
||||
if (
|
||||
((conn != null) && (conn.getResponseCode() == HttpURLConnection.HTTP_OK))
|
||||
|| ((conn_s != null) && (conn_s.getResponseCode() == HttpURLConnection.HTTP_OK))
|
||||
)
|
||||
{
|
||||
|
||||
// Retreive the XML from the URL
|
||||
|
Loading…
Reference in New Issue
Block a user