mirror of
https://github.com/moparisthebest/android-app
synced 2025-01-11 13:18:00 -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"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest package="fr.gaulupeau.apps.InThePoche"
|
<manifest package="fr.gaulupeau.apps.InThePoche"
|
||||||
android:versionCode="6"
|
android:versionCode="7"
|
||||||
android:versionName="1.5.3" xmlns:android="http://schemas.android.com/apk/res/android">
|
android:versionName="@string/version" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<uses-sdk android:minSdkVersion="8"
|
<uses-sdk android:minSdkVersion="8"
|
||||||
android:targetSdkVersion="8" />
|
android:targetSdkVersion="8" />
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
@ -90,6 +90,14 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="@string/btnDone" />
|
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
|
<TextView
|
||||||
android:id="@+id/author"
|
android:id="@+id/author"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -23,4 +23,5 @@
|
|||||||
<string name="txtGlobalToken"><b><u>API global token :</u></b></string>
|
<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="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="txtAPIToken"><b><u>Your token (token in Feed URL):</u></b></string>
|
||||||
|
<string name="version">1.5.3.1</string>
|
||||||
</resources>
|
</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
|
// 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 );
|
url = new URL(pocheUrl + "/?feed&type=home&user_id=" + apiUsername + "&token=" + apiToken );
|
||||||
// Setup the connection
|
// Setup the connection
|
||||||
trustEveryone();
|
HttpsURLConnection conn_s = null;
|
||||||
HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
|
HttpURLConnection conn = null;
|
||||||
if (conn.getResponseCode() == HttpURLConnection.HTTP_OK)
|
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
|
// Retreive the XML from the URL
|
||||||
|
Loading…
Reference in New Issue
Block a user