Big commit: Android Studio + Re-enable ContactList view and make it working to prepare SMS restauration
@@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="fr.unix_experience.owncloud_sms"
|
||||
android:versionCode="27"
|
||||
android:versionName="0.18.5" >
|
||||
|
||||
<!-- From Android 4.0 to 5.1 -->
|
||||
<uses-sdk
|
||||
android:maxSdkVersion="22"
|
||||
android:minSdkVersion="14"
|
||||
android:targetSdkVersion="22" />
|
||||
|
||||
<uses-permission android:name="android.permission.READ_SMS" />
|
||||
<!-- For SMS Broadcaster -->
|
||||
<uses-permission android:name="android.permission.RECEIVE_SMS" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
||||
<!-- For syncer -->
|
||||
<uses-permission android:name="android.permission.READ_SYNC_STATS" />
|
||||
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
|
||||
<!-- For account management -->
|
||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/OcSmsTheme" >
|
||||
|
||||
<!-- Related to periodic sync -->
|
||||
<service
|
||||
android:name=".observers.SmsObserverService"
|
||||
android:exported="false" />
|
||||
<service
|
||||
android:name=".sync_adapters.SmsSyncService"
|
||||
android:exported="true"
|
||||
android:process=":sync" >
|
||||
<intent-filter>
|
||||
<action android:name="android.content.SyncAdapter" />
|
||||
</intent-filter>
|
||||
|
||||
<meta-data
|
||||
android:name="android.content.SyncAdapter"
|
||||
android:resource="@xml/sync_adapter" />
|
||||
</service>
|
||||
|
||||
<provider
|
||||
android:name=".providers.SmsDataProvider"
|
||||
android:authorities="@string/account_authority"
|
||||
android:label="@string/pref_title_sync" >
|
||||
</provider>
|
||||
|
||||
<!--
|
||||
<service
|
||||
android:name=".sync_adapters.SmsSlowSyncService"
|
||||
android:exported="true"
|
||||
android:process=":sync">
|
||||
<intent-filter>
|
||||
<action android:name="android.content.SyncAdapter" />
|
||||
</intent-filter>
|
||||
|
||||
<meta-data
|
||||
android:name="android.content.SyncAdapter"
|
||||
android:resource="@xml/slow_sync_adapter" />
|
||||
</service>
|
||||
|
||||
<provider
|
||||
android:name=".providers.SmsDataProvider"
|
||||
android:label="@string/pref_title_slow_sync"
|
||||
android:authorities="@string/slowsync_account_authority">
|
||||
</provider>
|
||||
-->
|
||||
|
||||
|
||||
<!-- Related to Login -->
|
||||
<service android:name=".authenticators.OwnCloudAuthenticatorService" >
|
||||
<intent-filter>
|
||||
<action android:name="android.accounts.AccountAuthenticator" />
|
||||
</intent-filter>
|
||||
|
||||
<meta-data
|
||||
android:name="android.accounts.AccountAuthenticator"
|
||||
android:resource="@xml/owncloud_account_authenticator" />
|
||||
</service>
|
||||
|
||||
<receiver android:name=".broadcast_receivers.IncomingSms" >
|
||||
<intent-filter>
|
||||
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<receiver android:name=".broadcast_receivers.ConnectivityChanged" >
|
||||
<intent-filter>
|
||||
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<activity
|
||||
android:name=".activities.LoginActivity"
|
||||
android:label="@string/title_activity_login" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name="fr.unix_experience.owncloud_sms.activities.remote_account.AccountListActivity"
|
||||
android:label="@string/title_activity_select_account" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activities.GeneralSettingsActivity"
|
||||
android:label="@string/title_activity_general_settings" >
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activities.MainActivity"
|
||||
android:label="@string/app_name" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<!--
|
||||
<activity
|
||||
android:name=".MainActivity2"
|
||||
android:label="@string/title_activity_main_activity2" >
|
||||
</activity>
|
||||
-->
|
||||
<activity
|
||||
android:name="fr.unix_experience.owncloud_sms.activities.remote_account.ContactListActivity"
|
||||
android:label="@string/title_activity_select_contact" >
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,125 @@
|
||||
package fr.unix_experience.owncloud_sms.activities;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.PeriodicSync;
|
||||
import android.os.Bundle;
|
||||
import android.preference.ListPreference;
|
||||
import android.util.Log;
|
||||
import fr.nrz.androidlib.activities.NrzSettingsActivity;
|
||||
import fr.unix_experience.owncloud_sms.R;
|
||||
import fr.unix_experience.owncloud_sms.defines.DefaultPrefs;
|
||||
import fr.unix_experience.owncloud_sms.prefs.OCSMSSharedPrefs;
|
||||
|
||||
public class GeneralSettingsActivity extends NrzSettingsActivity {
|
||||
private static final String TAG = GeneralSettingsActivity.class.getSimpleName();
|
||||
|
||||
private static AccountManager _accountMgr;
|
||||
private static String _accountAuthority;
|
||||
private static String _accountType;
|
||||
|
||||
@Override
|
||||
protected void onPostCreate(final Bundle savedInstanceState) {
|
||||
_accountMgr = AccountManager.get(getBaseContext());
|
||||
_accountAuthority = getString(R.string.account_authority);
|
||||
_accountType = getString(R.string.account_type);
|
||||
_prefsRessourceFile = R.xml.pref_data_sync;
|
||||
|
||||
// Bind our boolean preferences
|
||||
_boolPrefs.add(new BindObjectPref("push_on_receive", DefaultPrefs.pushOnReceive));
|
||||
_boolPrefs.add(new BindObjectPref("sync_wifi", DefaultPrefs.syncWifi));
|
||||
_boolPrefs.add(new BindObjectPref("sync_4g", DefaultPrefs.sync4G));
|
||||
_boolPrefs.add(new BindObjectPref("sync_3g", DefaultPrefs.sync3G));
|
||||
_boolPrefs.add(new BindObjectPref("sync_gprs", DefaultPrefs.syncGPRS));
|
||||
_boolPrefs.add(new BindObjectPref("sync_2g", DefaultPrefs.sync2G));
|
||||
_boolPrefs.add(new BindObjectPref("sync_others", DefaultPrefs.syncOthers));
|
||||
|
||||
// Bind our string preferences
|
||||
_stringPrefs.add(new BindObjectPref("sync_frequency", ""));
|
||||
|
||||
// Must be at the end, after preference bind
|
||||
super.onPostCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
protected static void handleCheckboxPreference(final String key, final Boolean value) {
|
||||
// Network types allowed for sync
|
||||
if(key.equals(new String("push_on_receive")) ||
|
||||
key.equals(new String("sync_wifi")) || key.equals("sync_2g") ||
|
||||
key.equals(new String("sync_3g")) || key.equals("sync_gprs") ||
|
||||
key.equals("sync_4g") || key.equals("sync_others")) {
|
||||
final OCSMSSharedPrefs prefs = new OCSMSSharedPrefs(_context);
|
||||
Log.d(TAG,"GeneralSettingsActivity.handleCheckboxPreference: set " + key + " to "
|
||||
+ value.toString());
|
||||
prefs.putBoolean(key, value);
|
||||
}
|
||||
else {
|
||||
// Unknown option
|
||||
}
|
||||
}
|
||||
|
||||
protected static void handleListPreference(final String key, final String value,
|
||||
final ListPreference preference) {
|
||||
// For list preferences, look up the correct display value in
|
||||
// the preference's 'entries' list.
|
||||
final int index = preference.findIndexOfValue(value);
|
||||
|
||||
// Set the summary to reflect the new value.
|
||||
preference
|
||||
.setSummary(index >= 0 ? preference.getEntries()[index]
|
||||
: null);
|
||||
|
||||
// Handle sync frequency change
|
||||
if (key.equals("sync_frequency")) {
|
||||
final Account[] myAccountList = _accountMgr.getAccountsByType(_accountType);
|
||||
final long syncFreq = Long.parseLong(value);
|
||||
|
||||
// Get ownCloud SMS account list
|
||||
for (int i = 0; i < myAccountList.length; i++) {
|
||||
// And get all authorities for this account
|
||||
final List<PeriodicSync> syncList = ContentResolver.getPeriodicSyncs(myAccountList[i], _accountAuthority);
|
||||
|
||||
boolean foundSameSyncCycle = false;
|
||||
for (int j = 0; j < syncList.size(); j++) {
|
||||
final PeriodicSync ps = syncList.get(i);
|
||||
|
||||
if (ps.period == syncFreq && ps.extras.getInt("synctype") == 1) {
|
||||
foundSameSyncCycle = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundSameSyncCycle == false) {
|
||||
final Bundle b = new Bundle();
|
||||
b.putInt("synctype", 1);
|
||||
|
||||
ContentResolver.removePeriodicSync(myAccountList[i],
|
||||
_accountAuthority, b);
|
||||
ContentResolver.addPeriodicSync(myAccountList[i],
|
||||
_accountAuthority, b, syncFreq * 60);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Unhandled option
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,337 @@
|
||||
package fr.unix_experience.owncloud_sms.activities;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.OwnCloudClientFactory;
|
||||
import com.owncloud.android.lib.common.OwnCloudCredentialsFactory;
|
||||
|
||||
import fr.unix_experience.owncloud_sms.R;
|
||||
import fr.unix_experience.owncloud_sms.authenticators.OwnCloudAuthenticator;
|
||||
import fr.unix_experience.owncloud_sms.defines.DefaultPrefs;
|
||||
import fr.unix_experience.owncloud_sms.enums.LoginReturnCode;
|
||||
|
||||
/**
|
||||
* A login screen that offers login via email/password.
|
||||
*/
|
||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||
public class LoginActivity extends Activity {
|
||||
/**
|
||||
* Keep track of the login task to ensure we can cancel it if requested.
|
||||
*/
|
||||
private UserLoginTask mAuthTask = null;
|
||||
|
||||
// UI references.
|
||||
private Spinner _protocolView;
|
||||
private EditText _loginView;
|
||||
private EditText _passwordView;
|
||||
private EditText _serverView;
|
||||
private View mProgressView;
|
||||
private View mLoginFormView;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_login);
|
||||
|
||||
// Set up the login form.
|
||||
_protocolView = (Spinner) findViewById(R.id.oc_protocol);
|
||||
_serverView = (EditText) findViewById(R.id.oc_server);
|
||||
_loginView = (EditText) findViewById(R.id.oc_login);
|
||||
|
||||
_passwordView = (EditText) findViewById(R.id.oc_password);
|
||||
_passwordView
|
||||
.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||
@Override
|
||||
public boolean onEditorAction(TextView textView, int id,
|
||||
KeyEvent keyEvent) {
|
||||
if (id == R.id.oc_login || id == EditorInfo.IME_NULL) {
|
||||
attemptLogin();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
Button _signInButton = (Button) findViewById(R.id.oc_signin_button);
|
||||
_signInButton.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
attemptLogin();
|
||||
}
|
||||
});
|
||||
|
||||
mLoginFormView = findViewById(R.id.login_form);
|
||||
mProgressView = findViewById(R.id.login_progress);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to sign in or register the account specified by the login form.
|
||||
* If there are form errors (invalid email, missing fields, etc.), the
|
||||
* errors are presented and no actual login attempt is made.
|
||||
*/
|
||||
public void attemptLogin() {
|
||||
if (mAuthTask != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Reset errors.
|
||||
_loginView.setError(null);
|
||||
_passwordView.setError(null);
|
||||
|
||||
// Store values at the time of the login attempt.
|
||||
String protocol = _protocolView.getSelectedItem().toString();
|
||||
String login = _loginView.getText().toString();
|
||||
String password = _passwordView.getText().toString();
|
||||
String serverAddr = _serverView.getText().toString();
|
||||
|
||||
boolean cancel = false;
|
||||
View focusView = null;
|
||||
|
||||
// Check for a valid server address.
|
||||
if (TextUtils.isEmpty(protocol)) {
|
||||
cancel = true;
|
||||
}
|
||||
|
||||
// Check for a valid server address.
|
||||
if (TextUtils.isEmpty(serverAddr)) {
|
||||
_serverView.setError(getString(R.string.error_field_required));
|
||||
focusView = _loginView;
|
||||
cancel = true;
|
||||
}
|
||||
|
||||
// Check for a valid login address.
|
||||
if (TextUtils.isEmpty(login)) {
|
||||
_loginView.setError(getString(R.string.error_field_required));
|
||||
focusView = _loginView;
|
||||
cancel = true;
|
||||
}
|
||||
|
||||
// Check for a valid password
|
||||
if (TextUtils.isEmpty(password)) {
|
||||
_passwordView.setError(getString(R.string.error_field_required));
|
||||
focusView = _passwordView;
|
||||
cancel = true;
|
||||
}
|
||||
|
||||
if (!isPasswordValid(password)) {
|
||||
_passwordView.setError(getString(R.string.error_invalid_password));
|
||||
focusView = _passwordView;
|
||||
cancel = true;
|
||||
}
|
||||
|
||||
if (cancel) {
|
||||
// There was an error; don't attempt login and focus the first
|
||||
// form field with an error.
|
||||
focusView.requestFocus();
|
||||
} else {
|
||||
// Show a progress spinner, and kick off a background task to
|
||||
// perform the user login attempt.
|
||||
showProgress(true);
|
||||
String serverURL = new String(protocol + serverAddr);
|
||||
mAuthTask = new UserLoginTask(serverURL, login, password);
|
||||
mAuthTask.execute((Void) null);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isPasswordValid(String password) {
|
||||
// TODO: Replace this with your own logic
|
||||
return password.length() > 4;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows the progress UI and hides the login form.
|
||||
*/
|
||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
|
||||
public void showProgress(final boolean show) {
|
||||
// On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow
|
||||
// for very easy animations. If available, use these APIs to fade-in
|
||||
// the progress spinner.
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
|
||||
int shortAnimTime = getResources().getInteger(
|
||||
android.R.integer.config_shortAnimTime);
|
||||
|
||||
mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);
|
||||
mLoginFormView.animate().setDuration(shortAnimTime)
|
||||
.alpha(show ? 0 : 1)
|
||||
.setListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
mLoginFormView.setVisibility(show ? View.GONE
|
||||
: View.VISIBLE);
|
||||
}
|
||||
});
|
||||
|
||||
mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
|
||||
mProgressView.animate().setDuration(shortAnimTime)
|
||||
.alpha(show ? 1 : 0)
|
||||
.setListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
mProgressView.setVisibility(show ? View.VISIBLE
|
||||
: View.GONE);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// The ViewPropertyAnimator APIs are not available, so simply show
|
||||
// and hide the relevant UI components.
|
||||
mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
|
||||
mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents an asynchronous login/registration task used to authenticate
|
||||
* the user.
|
||||
*/
|
||||
public class UserLoginTask extends AsyncTask<Void, Void, Boolean> {
|
||||
|
||||
UserLoginTask(String serverURI, String login, String password) {
|
||||
_serverURI = Uri.parse(serverURI);
|
||||
_login = login;
|
||||
_password = password;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Boolean doInBackground(Void... params) {
|
||||
// Create client object to perform remote operations
|
||||
OwnCloudClient ocClient = OwnCloudClientFactory.createOwnCloudClient(
|
||||
_serverURI, getBaseContext(),
|
||||
// Activity or Service context
|
||||
true
|
||||
);
|
||||
|
||||
// Set basic credentials
|
||||
ocClient.setCredentials(
|
||||
OwnCloudCredentialsFactory.newBasicCredentials(_login, _password)
|
||||
);
|
||||
|
||||
// Send an authentication test to ownCloud
|
||||
OwnCloudAuthenticator at = new OwnCloudAuthenticator(getBaseContext());
|
||||
at.setClient(ocClient);
|
||||
|
||||
_returnCode = at.testCredentials();
|
||||
|
||||
return (_returnCode == LoginReturnCode.OK);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(final Boolean success) {
|
||||
mAuthTask = null;
|
||||
showProgress(false);
|
||||
|
||||
if (success) {
|
||||
String accountType = getIntent().getStringExtra(PARAM_AUTHTOKEN_TYPE);
|
||||
if (accountType == null) {
|
||||
accountType = getString(R.string.account_type);
|
||||
}
|
||||
|
||||
// Generate a label
|
||||
String accountLabel = _login + "@" + _serverURI.getHost();
|
||||
|
||||
// We create the account
|
||||
final Account account = new Account(accountLabel, accountType);
|
||||
Bundle accountBundle = new Bundle();
|
||||
accountBundle.putString("ocLogin", _login);
|
||||
accountBundle.putString("ocURI", _serverURI.toString());
|
||||
|
||||
// And we push it to Android
|
||||
AccountManager accMgr = AccountManager.get(getApplicationContext());
|
||||
accMgr.addAccountExplicitly(account, _password, accountBundle);
|
||||
|
||||
// Set sync options
|
||||
ContentResolver.setSyncAutomatically(account, getString(R.string.account_authority), true);
|
||||
|
||||
Bundle b = new Bundle();
|
||||
b.putInt("synctype", 1);
|
||||
|
||||
ContentResolver.addPeriodicSync(account, getString(R.string.account_authority), b, DefaultPrefs.syncInterval * 60);
|
||||
// Then it's finished
|
||||
finish();
|
||||
|
||||
// Start sync settings, we have finished to configure account
|
||||
Intent settingsIntent = new Intent(Settings.ACTION_SYNC_SETTINGS);
|
||||
settingsIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
getApplicationContext().startActivity(settingsIntent);
|
||||
} else {
|
||||
switch (_returnCode) {
|
||||
case INVALID_ADDR:
|
||||
_serverView.setError(getString(R.string.error_invalid_server_address));
|
||||
_serverView.requestFocus();
|
||||
break;
|
||||
case HTTP_CONN_FAILED:
|
||||
_serverView.setError(getString(R.string.error_http_connection_failed));
|
||||
_serverView.requestFocus();
|
||||
break;
|
||||
case CONN_FAILED:
|
||||
_serverView.setError(getString(R.string.error_connection_failed));
|
||||
_serverView.requestFocus();
|
||||
break;
|
||||
case INVALID_LOGIN:
|
||||
_passwordView.setError(getString(R.string.error_invalid_login));
|
||||
_passwordView.requestFocus();
|
||||
break;
|
||||
case UNKNOWN_ERROR:
|
||||
_serverView.setError("UNK");
|
||||
_serverView.requestFocus();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCancelled() {
|
||||
mAuthTask = null;
|
||||
showProgress(false);
|
||||
}
|
||||
|
||||
private final Uri _serverURI;
|
||||
private final String _login;
|
||||
private final String _password;
|
||||
private LoginReturnCode _returnCode;
|
||||
|
||||
public static final String PARAM_AUTHTOKEN_TYPE = "auth.token";
|
||||
public static final String PARAM_CREATE = "create";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
package fr.unix_experience.owncloud_sms.activities;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.json.JSONArray;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Fragment;
|
||||
import android.app.FragmentManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.support.v13.app.FragmentPagerAdapter;
|
||||
import android.support.v4.view.PagerAdapter;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Toast;
|
||||
import fr.unix_experience.owncloud_sms.R;
|
||||
import fr.unix_experience.owncloud_sms.activities.remote_account.AccountListActivity;
|
||||
import fr.unix_experience.owncloud_sms.engine.ASyncSMSSync.SyncTask;
|
||||
import fr.unix_experience.owncloud_sms.engine.ConnectivityMonitor;
|
||||
import fr.unix_experience.owncloud_sms.engine.SmsFetcher;
|
||||
import fr.unix_experience.owncloud_sms.notifications.OCSMSNotificationManager;
|
||||
|
||||
public class MainActivity extends Activity {
|
||||
|
||||
/**
|
||||
* The {@link android.support.v4.view.PagerAdapter} that will provide
|
||||
* fragments for each of the sections. We use a {@link FragmentPagerAdapter}
|
||||
* derivative, which will keep every loaded fragment in memory. If this
|
||||
* becomes too memory intensive, it may be best to switch to a
|
||||
* {@link android.support.v4.app.FragmentStatePagerAdapter}.
|
||||
*/
|
||||
PagerAdapter mPagerAdapter;
|
||||
|
||||
/**
|
||||
* The {@link ViewPager} that will host the section contents.
|
||||
*/
|
||||
ViewPager mViewPager;
|
||||
|
||||
@Override
|
||||
protected void onCreate(final Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
// Create the adapter that will return a fragment for each of the three
|
||||
// primary sections of the activity.
|
||||
|
||||
final List<Fragment> fragments = new Vector<Fragment>();
|
||||
|
||||
/*
|
||||
* Add the Main tabs here
|
||||
*/
|
||||
|
||||
fragments.add(Fragment.instantiate(this,StarterFragment.class.getName()));
|
||||
fragments.add(Fragment.instantiate(this,SecondTestFragment.class.getName()));
|
||||
fragments.add(Fragment.instantiate(this,ThanksAndRateFragment.class.getName()));
|
||||
|
||||
mPagerAdapter = new MainPagerAdapter(getFragmentManager(), fragments);
|
||||
|
||||
// Set up the ViewPager with the sections adapter.
|
||||
mViewPager = (ViewPager) findViewById(R.id.pager);
|
||||
mViewPager.setAdapter(mPagerAdapter);
|
||||
}
|
||||
|
||||
/**
|
||||
* A {@link FragmentPagerAdapter} that returns a fragment corresponding to
|
||||
* one of the sections/tabs/pages.
|
||||
*/
|
||||
public class MainPagerAdapter extends FragmentPagerAdapter {
|
||||
|
||||
private final List<Fragment> mFragments;
|
||||
|
||||
public MainPagerAdapter(final FragmentManager fragmentManager, final List<Fragment> fragments) {
|
||||
super(fragmentManager);
|
||||
mFragments = fragments;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(final int position) {
|
||||
// getItem is called to instantiate the fragment for the given page.
|
||||
// Return a PlaceholderFragment (defined as a static inner class
|
||||
// below).
|
||||
return mFragments.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
// Show 3 total pages.
|
||||
return mFragments.size();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fragments for activity must be there
|
||||
*/
|
||||
public static class StarterFragment extends Fragment {
|
||||
@Override
|
||||
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
|
||||
final Bundle savedInstanceState) {
|
||||
final View rootView = inflater.inflate(R.layout.fragment_mainactivity_main, container,
|
||||
false);
|
||||
return rootView;
|
||||
}
|
||||
}
|
||||
|
||||
public static class SecondTestFragment extends Fragment {
|
||||
@Override
|
||||
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
|
||||
final Bundle savedInstanceState) {
|
||||
final View rootView = inflater.inflate(R.layout.fragment_mainactivity_gotosettings, container,
|
||||
false);
|
||||
return rootView;
|
||||
}
|
||||
}
|
||||
|
||||
public static class ThanksAndRateFragment extends Fragment {
|
||||
@Override
|
||||
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
|
||||
final Bundle savedInstanceState) {
|
||||
final View rootView = inflater.inflate(R.layout.fragment_mainactivity_thanks_note, container,
|
||||
false);
|
||||
return rootView;
|
||||
}
|
||||
}
|
||||
|
||||
public void openAppSettings(final View view) {
|
||||
startActivity(new Intent(this, GeneralSettingsActivity.class));
|
||||
}
|
||||
|
||||
public void openAddAccount(final View view) {
|
||||
startActivity(new Intent(Settings.ACTION_ADD_ACCOUNT));
|
||||
}
|
||||
|
||||
public void syncAllMessages(final View view) {
|
||||
final Context ctx = getApplicationContext();
|
||||
final ConnectivityMonitor cMon = new ConnectivityMonitor(ctx);
|
||||
|
||||
if (cMon.isValid()) {
|
||||
// Now fetch messages since last stored date
|
||||
final JSONArray smsList = new SmsFetcher(ctx)
|
||||
.bufferizeMessagesSinceDate((long) 0);
|
||||
|
||||
if (smsList != null) {
|
||||
final OCSMSNotificationManager nMgr = new OCSMSNotificationManager(ctx);
|
||||
nMgr.setSyncProcessMsg();
|
||||
new SyncTask(getApplicationContext(), smsList).execute();
|
||||
}
|
||||
}
|
||||
else {
|
||||
Toast.makeText(ctx, ctx.getString(R.string.err_sync_no_connection_available), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
public void selectRemoteAccount(final View view) {
|
||||
startActivity(new Intent(this, AccountListActivity.class));
|
||||
}
|
||||
|
||||
public void openGooglePlayStore(final View view) {
|
||||
Intent intent;
|
||||
try {
|
||||
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + getPackageName()));
|
||||
|
||||
} catch (final android.content.ActivityNotFoundException anfe) {
|
||||
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + getPackageName()));
|
||||
}
|
||||
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package fr.unix_experience.owncloud_sms.activities.remote_account;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
import android.app.ListActivity;
|
||||
import android.os.Bundle;
|
||||
import fr.nrz.androidlib.adapters.AndroidAccountAdapter;
|
||||
import fr.unix_experience.owncloud_sms.R;
|
||||
|
||||
public class AccountListActivity extends ListActivity {
|
||||
ArrayList<Account> listItems = new ArrayList<Account>();
|
||||
AndroidAccountAdapter adapter;
|
||||
|
||||
@Override
|
||||
public void onCreate(final Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
|
||||
final AccountManager _accountMgr = AccountManager.get(getBaseContext());
|
||||
|
||||
setContentView(R.layout.restore_activity_accountlist);
|
||||
adapter = new AndroidAccountAdapter(this,
|
||||
android.R.layout.simple_list_item_1,
|
||||
listItems,
|
||||
R.layout.account_list_item,
|
||||
R.id.accountname, ContactListActivity.class);
|
||||
setListAdapter(adapter);
|
||||
|
||||
final Account[] accountList =
|
||||
_accountMgr.getAccountsByType(getString(R.string.account_type));
|
||||
for (final Account element : accountList) {
|
||||
listItems.add(element);
|
||||
}
|
||||
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package fr.unix_experience.owncloud_sms.activities.remote_account;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
import android.app.ListActivity;
|
||||
import android.os.Bundle;
|
||||
import fr.nrz.androidlib.adapters.AndroidAccountAdapter;
|
||||
import fr.unix_experience.owncloud_sms.R;
|
||||
import fr.unix_experience.owncloud_sms.adapters.ContactListAdapter;
|
||||
import fr.unix_experience.owncloud_sms.engine.ASyncContactLoad;
|
||||
|
||||
public class ContactListActivity extends ListActivity implements ASyncContactLoad {
|
||||
|
||||
static AccountManager _accountMgr;
|
||||
ContactListAdapter adapter;
|
||||
|
||||
@Override
|
||||
protected void onCreate(final Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
assert getIntent().getExtras() != null;
|
||||
|
||||
final String accountName = getIntent().getExtras().getString("account");
|
||||
|
||||
// accountName cannot be null, devel error
|
||||
assert accountName != null;
|
||||
|
||||
_accountMgr = AccountManager.get(getBaseContext());
|
||||
final Account[] myAccountList =
|
||||
_accountMgr.getAccountsByType(getString(R.string.account_type));
|
||||
|
||||
// Init view
|
||||
ArrayList<String> objects = new ArrayList<String>();
|
||||
setContentView(R.layout.restore_activity_contactlist);
|
||||
adapter = new ContactListAdapter(getBaseContext(),
|
||||
android.R.layout.simple_list_item_1,
|
||||
objects,
|
||||
R.layout.contact_list_item,
|
||||
R.id.contactname);
|
||||
|
||||
setListAdapter(adapter);
|
||||
|
||||
for (final Account element : myAccountList) {
|
||||
if (element.name.equals(accountName)) {
|
||||
new ContactLoadTask(element, getBaseContext(), adapter, objects).execute();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This function fetch contacts from the ownCloud instance and generate the list activity
|
||||
private void loadContacts(final Account account) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package fr.unix_experience.owncloud_sms.adapters;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class ContactListAdapter extends ArrayAdapter<String> {
|
||||
private final ArrayList<String> _objects;
|
||||
private static int _itemLayout;
|
||||
private static int _fieldId;
|
||||
|
||||
public ContactListAdapter(final Context context, final int resource,
|
||||
final ArrayList<String> objects, final int itemLayout,
|
||||
final int fieldId) {
|
||||
super(context, resource, resource, objects);
|
||||
_objects = objects;
|
||||
_itemLayout = itemLayout;
|
||||
_fieldId = fieldId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(final int position, final View convertView, final ViewGroup parent) {
|
||||
View v = convertView;
|
||||
if (v == null) {
|
||||
final LayoutInflater inflater =
|
||||
(LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
v = inflater.inflate(_itemLayout, null);
|
||||
}
|
||||
|
||||
final String element = _objects.get(position);
|
||||
|
||||
if (element != null) {
|
||||
final TextView label = (TextView) v.findViewById(_fieldId);
|
||||
if (label != null) {
|
||||
label.setText(element + " >");
|
||||
label.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final View v) {
|
||||
// @TODO
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return v;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
package fr.unix_experience.owncloud_sms.authenticators;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
import org.apache.commons.httpclient.HttpException;
|
||||
import org.apache.commons.httpclient.methods.GetMethod;
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
|
||||
import fr.unix_experience.owncloud_sms.activities.LoginActivity;
|
||||
import fr.unix_experience.owncloud_sms.enums.LoginReturnCode;
|
||||
import android.accounts.AbstractAccountAuthenticator;
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountAuthenticatorResponse;
|
||||
import android.accounts.AccountManager;
|
||||
import android.accounts.NetworkErrorException;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
public class OwnCloudAuthenticator extends AbstractAccountAuthenticator {
|
||||
// Simple constructor
|
||||
public OwnCloudAuthenticator(Context context) {
|
||||
super(context);
|
||||
_context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Bundle editProperties(AccountAuthenticatorResponse response,
|
||||
String accountType) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Bundle addAccount(AccountAuthenticatorResponse response,
|
||||
String accountType, String authTokenType,
|
||||
String[] requiredFeatures, Bundle options)
|
||||
throws NetworkErrorException {
|
||||
final Bundle result;
|
||||
final Intent intent;
|
||||
|
||||
intent = new Intent(_context, LoginActivity.class);
|
||||
|
||||
result = new Bundle();
|
||||
result.putParcelable(AccountManager.KEY_INTENT, intent);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Bundle confirmCredentials(AccountAuthenticatorResponse response,
|
||||
Account account, Bundle options) throws NetworkErrorException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Bundle getAuthToken(AccountAuthenticatorResponse response,
|
||||
Account account, String authTokenType, Bundle options)
|
||||
throws NetworkErrorException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAuthTokenLabel(String authTokenType) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Bundle updateCredentials(AccountAuthenticatorResponse response,
|
||||
Account account, String authTokenType, Bundle options)
|
||||
throws NetworkErrorException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Bundle hasFeatures(AccountAuthenticatorResponse response,
|
||||
Account account, String[] features) throws NetworkErrorException {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return codes
|
||||
* 1: invalid address
|
||||
* 2: HTTP failed
|
||||
* 3: connexion failed
|
||||
* 4: invalid login
|
||||
* 5: unknown error
|
||||
*/
|
||||
public LoginReturnCode testCredentials() {
|
||||
LoginReturnCode bRet = LoginReturnCode.OK;
|
||||
GetMethod get = null;
|
||||
int status = -1;
|
||||
|
||||
try {
|
||||
get = new GetMethod(_client.getBaseUri() + "/index.php/ocs/cloud/user?format=json");
|
||||
} catch (IllegalArgumentException e) {
|
||||
return LoginReturnCode.INVALID_ADDR;
|
||||
}
|
||||
|
||||
get.addRequestHeader("OCS-APIREQUEST", "true");
|
||||
|
||||
try {
|
||||
status = _client.executeMethod(get);
|
||||
} catch (IllegalArgumentException e) {
|
||||
return LoginReturnCode.INVALID_ADDR;
|
||||
} catch (HttpException e) {
|
||||
return LoginReturnCode.HTTP_CONN_FAILED;
|
||||
} catch (IOException e) {
|
||||
return LoginReturnCode.CONN_FAILED;
|
||||
}
|
||||
|
||||
try {
|
||||
if(isSuccess(status)) {
|
||||
String response = get.getResponseBodyAsString();
|
||||
Log.d(TAG, "Successful response: " + response);
|
||||
|
||||
// Parse the response
|
||||
JSONObject respJSON = new JSONObject(response);
|
||||
JSONObject respOCS = respJSON.getJSONObject(NODE_OCS);
|
||||
JSONObject respData = respOCS.getJSONObject(NODE_DATA);
|
||||
String id = respData.getString(NODE_ID);
|
||||
String displayName = respData.getString(NODE_DISPLAY_NAME);
|
||||
String email = respData.getString(NODE_EMAIL);
|
||||
|
||||
Log.d(TAG, "*** Parsed user information: " + id + " - " + displayName + " - " + email);
|
||||
|
||||
} else {
|
||||
String response = get.getResponseBodyAsString();
|
||||
Log.e(TAG, "Failed response while getting user information ");
|
||||
if (response != null) {
|
||||
Log.e(TAG, "*** status code: " + status + " ; response message: " + response);
|
||||
} else {
|
||||
Log.e(TAG, "*** status code: " + status);
|
||||
}
|
||||
|
||||
if (status == 401) {
|
||||
bRet = LoginReturnCode.INVALID_LOGIN;
|
||||
}
|
||||
else {
|
||||
bRet = LoginReturnCode.UNKNOWN_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Exception while getting OC user information", e);
|
||||
bRet = LoginReturnCode.UNKNOWN_ERROR;
|
||||
|
||||
} finally {
|
||||
get.releaseConnection();
|
||||
}
|
||||
return bRet;
|
||||
}
|
||||
|
||||
private boolean isSuccess(int status) {
|
||||
return (status == HttpStatus.SC_OK);
|
||||
}
|
||||
|
||||
public void setClient(OwnCloudClient oc) {
|
||||
_client = oc;
|
||||
}
|
||||
|
||||
private Context _context;
|
||||
private OwnCloudClient _client;
|
||||
|
||||
private static final String TAG = OwnCloudAuthenticator.class.getSimpleName();
|
||||
|
||||
private static final String NODE_OCS = "ocs";
|
||||
private static final String NODE_DATA = "data";
|
||||
private static final String NODE_ID = "id";
|
||||
private static final String NODE_DISPLAY_NAME= "display-name";
|
||||
private static final String NODE_EMAIL= "email";
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package fr.unix_experience.owncloud_sms.authenticators;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
|
||||
public class OwnCloudAuthenticatorService extends Service {
|
||||
// Instance field that stores the authenticator object
|
||||
private OwnCloudAuthenticator mAuthenticator;
|
||||
@Override
|
||||
public void onCreate() {
|
||||
// Create a new authenticator object
|
||||
mAuthenticator = new OwnCloudAuthenticator(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return mAuthenticator.getIBinder();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package fr.unix_experience.owncloud_sms.broadcast_receivers;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import org.json.JSONArray;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
import fr.unix_experience.owncloud_sms.engine.ASyncSMSSync;
|
||||
import fr.unix_experience.owncloud_sms.engine.ConnectivityMonitor;
|
||||
import fr.unix_experience.owncloud_sms.engine.SmsFetcher;
|
||||
import fr.unix_experience.owncloud_sms.prefs.OCSMSSharedPrefs;
|
||||
|
||||
public class ConnectivityChanged extends BroadcastReceiver implements ASyncSMSSync {
|
||||
|
||||
@Override
|
||||
public void onReceive(final Context context, final Intent intent) {
|
||||
final ConnectivityMonitor cMon = new ConnectivityMonitor(context);
|
||||
|
||||
final OCSMSSharedPrefs prefs = new OCSMSSharedPrefs(context);
|
||||
|
||||
if (!prefs.pushOnReceive()) {
|
||||
Log.d(TAG,"ConnectivityChanges.onReceive: pushOnReceive is disabled");
|
||||
return;
|
||||
}
|
||||
|
||||
// If data is available and previous dataConnectionState was false, then we need to sync
|
||||
if (cMon.isValid() && dataConnectionAvailable == false) {
|
||||
dataConnectionAvailable = true;
|
||||
Log.d(TAG,"ConnectivityChanged.onReceive, data conn available");
|
||||
checkMessagesAndSend(context);
|
||||
}
|
||||
// No data available and previous dataConnectionState was true
|
||||
else if (dataConnectionAvailable == true && !cMon.isValid()) {
|
||||
dataConnectionAvailable = false;
|
||||
Log.d(TAG,"ConnectivityChanges.onReceive: data conn is off");
|
||||
}
|
||||
}
|
||||
|
||||
private void checkMessagesAndSend(final Context context) {
|
||||
// Get last message synced from preferences
|
||||
final Long lastMessageSynced = (new OCSMSSharedPrefs(context)).getLastMessageDate();
|
||||
Log.d(TAG,"Synced Last:" + lastMessageSynced);
|
||||
|
||||
// Now fetch messages since last stored date
|
||||
final JSONArray smsList = new SmsFetcher(context).bufferizeMessagesSinceDate(lastMessageSynced);
|
||||
|
||||
final ConnectivityMonitor cMon = new ConnectivityMonitor(context);
|
||||
|
||||
// Synchronize if network is valid and there are SMS
|
||||
if (cMon.isValid() && smsList != null) {
|
||||
new SyncTask(context, smsList).execute();
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean dataConnectionAvailable = false;
|
||||
|
||||
private static final String TAG = ConnectivityChanged.class.getSimpleName();
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package fr.unix_experience.owncloud_sms.broadcast_receivers;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import fr.unix_experience.owncloud_sms.observers.SmsObserver;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
|
||||
public class IncomingSms extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (_mboxObserver == null) {
|
||||
Log.d(TAG,"_mboxObserver == null");
|
||||
_mboxObserver = new SmsObserver(new Handler(), context);
|
||||
context.getContentResolver().
|
||||
registerContentObserver(Uri.parse("content://sms"), true, _mboxObserver);
|
||||
}
|
||||
}
|
||||
|
||||
private static SmsObserver _mboxObserver;
|
||||
|
||||
private static final String TAG = IncomingSms.class.getSimpleName();
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package fr.unix_experience.owncloud_sms.defines;
|
||||
|
||||
public class DefaultPrefs {
|
||||
public final static Integer syncInterval = 15;
|
||||
public final static Boolean pushOnReceive = true;
|
||||
|
||||
public final static Boolean syncWifi = true;
|
||||
public final static Boolean sync2G = true;
|
||||
public final static Boolean syncGPRS = true;
|
||||
public final static Boolean sync3G = true;
|
||||
public final static Boolean sync4G = true;
|
||||
public final static Boolean syncOthers = true;
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package fr.unix_experience.owncloud_sms.engine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.util.Log;
|
||||
import fr.unix_experience.owncloud_sms.adapters.ContactListAdapter;
|
||||
import fr.unix_experience.owncloud_sms.exceptions.OCSyncException;
|
||||
|
||||
public interface ASyncContactLoad {
|
||||
class ContactLoadTask extends AsyncTask<Void, Void, Boolean> {
|
||||
private static AccountManager _accountMgr = null;
|
||||
private static Account _account;
|
||||
private final Context _context;
|
||||
private ContactListAdapter _adapter;
|
||||
private ArrayList<String> _objects;
|
||||
|
||||
public ContactLoadTask(final Account account, final Context context,
|
||||
ContactListAdapter adapter, ArrayList<String> objects) {
|
||||
if (_accountMgr == null) {
|
||||
_accountMgr = AccountManager.get(context);
|
||||
}
|
||||
|
||||
_account = account;
|
||||
_context = context;
|
||||
_adapter = adapter;
|
||||
_objects = objects;
|
||||
}
|
||||
@Override
|
||||
protected Boolean doInBackground(final Void... params) {
|
||||
// Create client
|
||||
final String ocURI = _accountMgr.getUserData(_account, "ocURI");
|
||||
if (ocURI == null) {
|
||||
// @TODO: Handle the problem
|
||||
return false;
|
||||
}
|
||||
|
||||
final Uri serverURI = Uri.parse(ocURI);
|
||||
|
||||
final OCSMSOwnCloudClient _client = new OCSMSOwnCloudClient(_context,
|
||||
serverURI, _accountMgr.getUserData(_account, "ocLogin"),
|
||||
_accountMgr.getPassword(_account));
|
||||
|
||||
try {
|
||||
if (_client.getServerAPIVersion() < 2) {
|
||||
// @TODO: handle error
|
||||
return false;
|
||||
}
|
||||
|
||||
JSONArray phoneNumbers = _client.getServerPhoneNumbers();
|
||||
Log.d(TAG, phoneNumbers.toString());
|
||||
for (int i = 0; i < phoneNumbers.length(); i++) {
|
||||
String phone = phoneNumbers.getString(i);
|
||||
_objects.add(phone);
|
||||
}
|
||||
|
||||
} catch (JSONException e) {
|
||||
// @TODO: handle error
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
} catch (final OCSyncException e) {
|
||||
// @TODO: handle error
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
protected void onPostExecute(final Boolean success) {
|
||||
_adapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
static final String TAG = ASyncContactLoad.class.getSimpleName();
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package fr.unix_experience.owncloud_sms.engine;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import org.json.JSONArray;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.util.Log;
|
||||
import fr.unix_experience.owncloud_sms.R;
|
||||
import fr.unix_experience.owncloud_sms.exceptions.OCSyncException;
|
||||
import fr.unix_experience.owncloud_sms.notifications.OCSMSNotificationManager;
|
||||
|
||||
public interface ASyncSMSSync {
|
||||
class SyncTask extends AsyncTask<Void, Void, Void> {
|
||||
public SyncTask(final Context context, final JSONArray smsList) {
|
||||
_context = context;
|
||||
_smsList = smsList;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(final Void... params) {
|
||||
final OCSMSNotificationManager nMgr = new OCSMSNotificationManager(_context);
|
||||
|
||||
// Get ownCloud SMS account list
|
||||
final AccountManager _accountMgr = AccountManager.get(_context);
|
||||
|
||||
final Account[] myAccountList = _accountMgr.getAccountsByType(_context.getString(R.string.account_type));
|
||||
for (final Account element : myAccountList) {
|
||||
final Uri serverURI = Uri.parse(_accountMgr.getUserData(element, "ocURI"));
|
||||
|
||||
final OCSMSOwnCloudClient _client = new OCSMSOwnCloudClient(_context,
|
||||
serverURI, _accountMgr.getUserData(element, "ocLogin"),
|
||||
_accountMgr.getPassword(element));
|
||||
|
||||
try {
|
||||
_client.doPushRequest(_smsList);
|
||||
nMgr.dropSyncErrorMsg();
|
||||
} catch (final OCSyncException e) {
|
||||
Log.e(TAG, _context.getString(e.getErrorId()));
|
||||
nMgr.setSyncErrorMsg(_context.getString(e.getErrorId()));
|
||||
}
|
||||
}
|
||||
nMgr.dropSyncProcessMsg();
|
||||
return null;
|
||||
}
|
||||
|
||||
private final Context _context;
|
||||
private final JSONArray _smsList;
|
||||
}
|
||||
|
||||
static final String TAG = ASyncSMSSync.class.getSimpleName();
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package fr.unix_experience.owncloud_sms.engine;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
*/
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.telephony.TelephonyManager;
|
||||
import fr.unix_experience.owncloud_sms.prefs.OCSMSSharedPrefs;
|
||||
|
||||
public class ConnectivityMonitor {
|
||||
public ConnectivityMonitor(final Context context) {
|
||||
_context = context;
|
||||
}
|
||||
|
||||
// Valid connection = WiFi or Mobile data
|
||||
public boolean isValid() {
|
||||
if (_cMgr == null) {
|
||||
_cMgr = (ConnectivityManager) _context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
}
|
||||
|
||||
final android.net.NetworkInfo niWiFi = _cMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
|
||||
final android.net.NetworkInfo niMobile = _cMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
|
||||
|
||||
if (niWiFi.isAvailable() || niMobile.isAvailable()) {
|
||||
// Load the connectivity manager to determine on which network we are connected
|
||||
final NetworkInfo netInfo = _cMgr.getActiveNetworkInfo();
|
||||
if (netInfo == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final OCSMSSharedPrefs prefs = new OCSMSSharedPrefs(_context);
|
||||
|
||||
// Check
|
||||
switch (netInfo.getType()) {
|
||||
case ConnectivityManager.TYPE_WIFI:
|
||||
return prefs.syncInWifi();
|
||||
case ConnectivityManager.TYPE_MOBILE:
|
||||
switch (netInfo.getSubtype()) {
|
||||
case TelephonyManager.NETWORK_TYPE_EDGE:
|
||||
case TelephonyManager.NETWORK_TYPE_CDMA:
|
||||
case TelephonyManager.NETWORK_TYPE_1xRTT:
|
||||
case TelephonyManager.NETWORK_TYPE_IDEN:
|
||||
return prefs.syncIn2G();
|
||||
case TelephonyManager.NETWORK_TYPE_GPRS:
|
||||
return prefs.syncInGPRS();
|
||||
case TelephonyManager.NETWORK_TYPE_HSDPA:
|
||||
case TelephonyManager.NETWORK_TYPE_HSPA:
|
||||
case TelephonyManager.NETWORK_TYPE_HSUPA:
|
||||
case TelephonyManager.NETWORK_TYPE_UMTS:
|
||||
case TelephonyManager.NETWORK_TYPE_EHRPD:
|
||||
case TelephonyManager.NETWORK_TYPE_EVDO_B:
|
||||
case TelephonyManager.NETWORK_TYPE_HSPAP:
|
||||
return prefs.syncIn3G();
|
||||
case TelephonyManager.NETWORK_TYPE_LTE:
|
||||
return prefs.syncIn4G();
|
||||
default:
|
||||
return prefs.syncInOtherModes();
|
||||
}
|
||||
default:
|
||||
return prefs.syncInOtherModes();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private ConnectivityManager _cMgr;
|
||||
private final Context _context;
|
||||
}
|
||||
@@ -0,0 +1,410 @@
|
||||
package fr.unix_experience.owncloud_sms.engine;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.ConnectException;
|
||||
|
||||
import org.apache.commons.httpclient.HttpException;
|
||||
import org.apache.commons.httpclient.HttpMethod;
|
||||
import org.apache.commons.httpclient.methods.GetMethod;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
import org.apache.commons.httpclient.methods.StringRequestEntity;
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.util.Log;
|
||||
|
||||
import com.owncloud.android.lib.common.OwnCloudClient;
|
||||
import com.owncloud.android.lib.common.OwnCloudClientFactory;
|
||||
import com.owncloud.android.lib.common.OwnCloudCredentialsFactory;
|
||||
|
||||
import fr.unix_experience.owncloud_sms.R;
|
||||
import fr.unix_experience.owncloud_sms.enums.OCSyncErrorType;
|
||||
import fr.unix_experience.owncloud_sms.exceptions.OCSyncException;
|
||||
import fr.unix_experience.owncloud_sms.prefs.OCSMSSharedPrefs;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class OCSMSOwnCloudClient {
|
||||
|
||||
public OCSMSOwnCloudClient(final Context context, final Uri serverURI, final String accountName, final String accountPassword) {
|
||||
_context = context;
|
||||
|
||||
_ocClient = OwnCloudClientFactory.createOwnCloudClient(
|
||||
serverURI, _context, true);
|
||||
|
||||
// Set basic credentials
|
||||
_ocClient.setCredentials(
|
||||
OwnCloudCredentialsFactory.newBasicCredentials(accountName, accountPassword)
|
||||
);
|
||||
|
||||
_serverAPIVersion = 1;
|
||||
}
|
||||
|
||||
public Integer getServerAPIVersion() throws OCSyncException {
|
||||
final GetMethod get = createGetVersionRequest();
|
||||
final JSONObject obj = doHttpRequest(get, true);
|
||||
if (obj == null) {
|
||||
// Return default version
|
||||
return 1;
|
||||
}
|
||||
|
||||
try {
|
||||
_serverAPIVersion = obj.getInt("version");
|
||||
}
|
||||
catch (final JSONException e) {
|
||||
Log.e(TAG, "No version received from server, assuming version 1", e);
|
||||
_serverAPIVersion = 1;
|
||||
}
|
||||
|
||||
return _serverAPIVersion;
|
||||
}
|
||||
|
||||
public JSONArray getServerPhoneNumbers() throws OCSyncException {
|
||||
final GetMethod get = createGetPhoneListRequest();
|
||||
final JSONObject obj = doHttpRequest(get, true);
|
||||
if (obj == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Log.d(TAG, obj.toString());
|
||||
try {
|
||||
return obj.getJSONArray("phoneList");
|
||||
} catch (final JSONException e) {
|
||||
Log.e(TAG, "No phonelist received from server, empty it", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void doPushRequest(final JSONArray smsList) throws OCSyncException {
|
||||
/**
|
||||
* If we need other API push, set it here
|
||||
*/
|
||||
switch (_serverAPIVersion) {
|
||||
case 1:
|
||||
default: doPushRequestV1(smsList); break;
|
||||
}
|
||||
}
|
||||
|
||||
public void doPushRequestV1(JSONArray smsList) throws OCSyncException {
|
||||
// We need to save this date as a step for connectivity change
|
||||
Long lastMsgDate = (long) 0;
|
||||
|
||||
if (smsList == null) {
|
||||
final GetMethod get = createGetSmsIdListRequest();
|
||||
final JSONObject smsGetObj = doHttpRequest(get);
|
||||
if (smsGetObj == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
JSONObject smsBoxes = new JSONObject();
|
||||
JSONArray inboxSmsList = null, sentSmsList = null, draftsSmsList = null;
|
||||
try {
|
||||
smsBoxes = smsGetObj.getJSONObject("smslist");
|
||||
} catch (final JSONException e) {
|
||||
try {
|
||||
smsGetObj.getJSONArray("smslist");
|
||||
} catch (final JSONException e2) {
|
||||
Log.e(TAG, "Invalid datas received from server (doPushRequest, get SMS list)", e);
|
||||
throw new OCSyncException(R.string.err_sync_get_smslist, OCSyncErrorType.PARSE);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
inboxSmsList = smsBoxes.getJSONArray("inbox");
|
||||
} catch (final JSONException e) {
|
||||
Log.d(TAG, "No inbox Sms received from server (doPushRequest, get SMS list)");
|
||||
}
|
||||
|
||||
try {
|
||||
sentSmsList = smsBoxes.getJSONArray("sent");
|
||||
} catch (final JSONException e) {
|
||||
Log.d(TAG, "No sent Sms received from server (doPushRequest, get SMS list)");
|
||||
}
|
||||
|
||||
try {
|
||||
draftsSmsList = smsBoxes.getJSONArray("drafts");
|
||||
} catch (final JSONException e) {
|
||||
Log.d(TAG, "No drafts Sms received from server (doPushRequest, get SMS list)");
|
||||
}
|
||||
|
||||
final SmsFetcher fetcher = new SmsFetcher(_context);
|
||||
fetcher.setExistingInboxMessages(inboxSmsList);
|
||||
fetcher.setExistingSentMessages(sentSmsList);
|
||||
fetcher.setExistingDraftsMessages(draftsSmsList);
|
||||
|
||||
smsList = fetcher.fetchAllMessages();
|
||||
|
||||
// Get maximum message date present in smsList to keep a step when connectivity changes
|
||||
lastMsgDate = fetcher.getLastMessageDate();
|
||||
}
|
||||
|
||||
if (smsList.length() == 0) {
|
||||
Log.d(TAG, "No new SMS to sync, sync done");
|
||||
return;
|
||||
}
|
||||
|
||||
final PostMethod post = createPushRequest(smsList);
|
||||
if (post == null) {
|
||||
Log.e(TAG,"Push request for POST is null");
|
||||
throw new OCSyncException(R.string.err_sync_craft_http_request, OCSyncErrorType.IO);
|
||||
}
|
||||
|
||||
final JSONObject obj = doHttpRequest(post);
|
||||
if (obj == null) {
|
||||
Log.e(TAG,"Request failed. It doesn't return a valid JSON Object");
|
||||
throw new OCSyncException(R.string.err_sync_push_request, OCSyncErrorType.IO);
|
||||
}
|
||||
|
||||
Boolean pushStatus;
|
||||
String pushMessage;
|
||||
try {
|
||||
pushStatus = obj.getBoolean("status");
|
||||
pushMessage = obj.getString("msg");
|
||||
}
|
||||
catch (final JSONException e) {
|
||||
Log.e(TAG, "Invalid datas received from server", e);
|
||||
throw new OCSyncException(R.string.err_sync_push_request_resp, OCSyncErrorType.PARSE);
|
||||
}
|
||||
|
||||
// Push was OK, we can save the lastMessageDate which was saved to server
|
||||
(new OCSMSSharedPrefs(_context)).setLastMessageDate(lastMsgDate);
|
||||
|
||||
Log.d(TAG, "SMS Push request said: status " + pushStatus + " - " + pushMessage);
|
||||
}
|
||||
|
||||
public GetMethod createGetVersionRequest() {
|
||||
return createGetRequest(OC_GET_VERSION);
|
||||
}
|
||||
|
||||
public GetMethod createGetPhoneListRequest() {
|
||||
return createGetRequest(OC_GET_PHONELIST);
|
||||
}
|
||||
|
||||
public GetMethod createGetSmsIdListRequest() {
|
||||
return createGetRequest(OC_GET_ALL_SMS_IDS);
|
||||
}
|
||||
|
||||
public GetMethod createGetSmsIdListWithStateRequest() {
|
||||
return createGetRequest(OC_GET_ALL_SMS_IDS_WITH_STATUS);
|
||||
}
|
||||
|
||||
public GetMethod createGetLastSmsTimestampRequest() {
|
||||
return createGetRequest(OC_GET_LAST_MSG_TIMESTAMP);
|
||||
}
|
||||
|
||||
private GetMethod createGetRequest(final String oc_call) {
|
||||
final GetMethod get = new GetMethod(_ocClient.getBaseUri() + oc_call);
|
||||
get.addRequestHeader("OCS-APIREQUEST", "true");
|
||||
return get;
|
||||
}
|
||||
|
||||
public PostMethod createPushRequest() throws OCSyncException {
|
||||
final SmsFetcher fetcher = new SmsFetcher(_context);
|
||||
final JSONArray smsList = fetcher.fetchAllMessages();
|
||||
return createPushRequest(smsList);
|
||||
}
|
||||
|
||||
public PostMethod createPushRequest(final JSONArray smsList) throws OCSyncException {
|
||||
final JSONObject obj = createPushJSONObject(smsList);
|
||||
if (obj == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final StringRequestEntity ent = createJSONRequestEntity(obj);
|
||||
if (ent == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final PostMethod post = new PostMethod(_ocClient.getBaseUri() + OC_PUSH_ROUTE);
|
||||
post.addRequestHeader("OCS-APIREQUEST", "true");
|
||||
post.setRequestEntity(ent);
|
||||
|
||||
return post;
|
||||
}
|
||||
|
||||
private JSONObject createPushJSONObject(final JSONArray smsList) throws OCSyncException {
|
||||
if (smsList == null) {
|
||||
Log.e(TAG,"NULL SMS List");
|
||||
throw new OCSyncException(R.string.err_sync_create_json_null_smslist, OCSyncErrorType.IO);
|
||||
}
|
||||
|
||||
final JSONObject reqJSON = new JSONObject();
|
||||
|
||||
try {
|
||||
reqJSON.put("smsDatas", smsList);
|
||||
reqJSON.put("smsCount", smsList == null ? 0 : smsList.length());
|
||||
} catch (final JSONException e) {
|
||||
Log.e(TAG,"JSON Exception when creating JSON request object");
|
||||
throw new OCSyncException(R.string.err_sync_create_json_put_smslist, OCSyncErrorType.PARSE);
|
||||
}
|
||||
|
||||
return reqJSON;
|
||||
}
|
||||
|
||||
private StringRequestEntity createJSONRequestEntity(final JSONObject obj) throws OCSyncException {
|
||||
StringRequestEntity requestEntity;
|
||||
try {
|
||||
requestEntity = new StringRequestEntity(
|
||||
obj.toString(),
|
||||
"application/json",
|
||||
"UTF-8");
|
||||
|
||||
} catch (final UnsupportedEncodingException e) {
|
||||
Log.e(TAG,"Unsupported encoding when generating request");
|
||||
throw new OCSyncException(R.string.err_sync_create_json_request_encoding, OCSyncErrorType.PARSE);
|
||||
}
|
||||
|
||||
return requestEntity;
|
||||
}
|
||||
|
||||
private JSONObject doHttpRequest(final HttpMethod req) throws OCSyncException {
|
||||
return doHttpRequest(req, false);
|
||||
}
|
||||
|
||||
// skipError permit to skip invalid JSON datas
|
||||
private JSONObject doHttpRequest(final HttpMethod req, final Boolean skipError) throws OCSyncException {
|
||||
JSONObject respJSON = null;
|
||||
int status = 0;
|
||||
|
||||
// We try maximumHttpReqTries because sometimes network is slow or unstable
|
||||
int tryNb = 0;
|
||||
final ConnectivityMonitor cMon = new ConnectivityMonitor(_context);
|
||||
|
||||
while (tryNb < maximumHttpReqTries) {
|
||||
tryNb++;
|
||||
|
||||
if (!cMon.isValid()) {
|
||||
if (tryNb == maximumHttpReqTries) {
|
||||
req.releaseConnection();
|
||||
throw new OCSyncException(R.string.err_sync_no_connection_available, OCSyncErrorType.IO);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
status = _ocClient.executeMethod(req);
|
||||
|
||||
Log.d(TAG, "HTTP Request done at try " + tryNb);
|
||||
|
||||
// Force loop exit
|
||||
tryNb = maximumHttpReqTries;
|
||||
} catch (final ConnectException e) {
|
||||
Log.e(TAG, "Unable to perform a connection to ownCloud instance", e);
|
||||
|
||||
// If it's the last try
|
||||
if (tryNb == maximumHttpReqTries) {
|
||||
req.releaseConnection();
|
||||
throw new OCSyncException(R.string.err_sync_http_request_connect, OCSyncErrorType.IO);
|
||||
}
|
||||
} catch (final HttpException e) {
|
||||
Log.e(TAG, "Unable to perform a connection to ownCloud instance", e);
|
||||
|
||||
// If it's the last try
|
||||
if (tryNb == maximumHttpReqTries) {
|
||||
req.releaseConnection();
|
||||
throw new OCSyncException(R.string.err_sync_http_request_httpexception, OCSyncErrorType.IO);
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
Log.e(TAG, "Unable to perform a connection to ownCloud instance", e);
|
||||
|
||||
// If it's the last try
|
||||
if (tryNb == maximumHttpReqTries) {
|
||||
req.releaseConnection();
|
||||
throw new OCSyncException(R.string.err_sync_http_request_ioexception, OCSyncErrorType.IO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(status == HttpStatus.SC_OK) {
|
||||
String response = null;
|
||||
try {
|
||||
response = req.getResponseBodyAsString();
|
||||
} catch (final IOException e) {
|
||||
Log.e(TAG, "Unable to parse server response", e);
|
||||
throw new OCSyncException(R.string.err_sync_http_request_resp, OCSyncErrorType.IO);
|
||||
}
|
||||
//Log.d(TAG, "Successful response: " + response);
|
||||
|
||||
// Parse the response
|
||||
try {
|
||||
respJSON = new JSONObject(response);
|
||||
} catch (final JSONException e) {
|
||||
if (skipError == false) {
|
||||
if (response.contains("ownCloud") && response.contains("DOCTYPE")) {
|
||||
Log.e(TAG, "OcSMS app not enabled or ownCloud upgrade is required");
|
||||
throw new OCSyncException(R.string.err_sync_ocsms_not_installed_or_oc_upgrade_required,
|
||||
OCSyncErrorType.SERVER_ERROR);
|
||||
}
|
||||
else {
|
||||
Log.e(TAG, "Unable to parse server response", e);
|
||||
throw new OCSyncException(R.string.err_sync_http_request_parse_resp, OCSyncErrorType.PARSE);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
} else if (status == HttpStatus.SC_FORBIDDEN) {
|
||||
// Authentication failed
|
||||
throw new OCSyncException(R.string.err_sync_auth_failed, OCSyncErrorType.AUTH);
|
||||
} else {
|
||||
// Unk error
|
||||
String response = null;
|
||||
try {
|
||||
response = req.getResponseBodyAsString();
|
||||
} catch (final IOException e) {
|
||||
Log.e(TAG, "Unable to parse server response", e);
|
||||
throw new OCSyncException(R.string.err_sync_http_request_resp, OCSyncErrorType.PARSE);
|
||||
}
|
||||
|
||||
Log.e(TAG, "Server set unhandled HTTP return code " + status);
|
||||
if (response != null) {
|
||||
Log.e(TAG, "Status code: " + status + ". Response message: " + response);
|
||||
} else {
|
||||
Log.e(TAG, "Status code: " + status);
|
||||
}
|
||||
throw new OCSyncException(R.string.err_sync_http_request_returncode_unhandled, OCSyncErrorType.SERVER_ERROR);
|
||||
}
|
||||
return respJSON;
|
||||
}
|
||||
|
||||
public OwnCloudClient getOCClient() { return _ocClient; }
|
||||
|
||||
private static int maximumHttpReqTries = 3;
|
||||
|
||||
private final OwnCloudClient _ocClient;
|
||||
private final Context _context;
|
||||
|
||||
private Integer _serverAPIVersion;
|
||||
|
||||
private static String OC_GET_VERSION = "/index.php/apps/ocsms/get/apiversion?format=json";
|
||||
private static String OC_GET_ALL_SMS_IDS = "/index.php/apps/ocsms/get/smsidlist?format=json";
|
||||
private static String OC_GET_ALL_SMS_IDS_WITH_STATUS = "/index.php/apps/ocsms/get/smsidstate?format=json";
|
||||
private static String OC_GET_LAST_MSG_TIMESTAMP = "/index.php/apps/ocsms/get/lastmsgtime?format=json";
|
||||
private static String OC_PUSH_ROUTE = "/index.php/apps/ocsms/push?format=json";
|
||||
private static String OC_GET_PHONELIST = "/index.php/apps/ocsms/get/phones/numberlist?format=json";
|
||||
|
||||
private static final String TAG = OCSMSOwnCloudClient.class.getSimpleName();
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,325 @@
|
||||
package fr.unix_experience.owncloud_sms.engine;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import fr.unix_experience.owncloud_sms.enums.MailboxID;
|
||||
import fr.unix_experience.owncloud_sms.providers.SmsDataProvider;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.util.Log;
|
||||
|
||||
public class SmsFetcher {
|
||||
public SmsFetcher(Context ct) {
|
||||
_lastMsgDate = (long) 0;
|
||||
_context = ct;
|
||||
|
||||
_existingInboxMessages = null;
|
||||
_existingSentMessages = null;
|
||||
_existingDraftsMessages = null;
|
||||
}
|
||||
|
||||
public JSONArray fetchAllMessages() {
|
||||
_jsonDataDump = new JSONArray();
|
||||
bufferizeMailboxMessages(MailboxID.INBOX);
|
||||
bufferizeMailboxMessages(MailboxID.SENT);
|
||||
bufferizeMailboxMessages(MailboxID.DRAFTS);
|
||||
return _jsonDataDump;
|
||||
}
|
||||
|
||||
private void bufferizeMailboxMessages(MailboxID mbID) {
|
||||
String mbURI = mapMailboxIDToURI(mbID);
|
||||
|
||||
if (_context == null || mbURI == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mbID != MailboxID.INBOX && mbID != MailboxID.SENT &&
|
||||
mbID != MailboxID.DRAFTS) {
|
||||
Log.e(TAG,"Unhandled MailboxID " + mbID.ordinal());
|
||||
return;
|
||||
}
|
||||
|
||||
// We generate a ID list for this message box
|
||||
String existingIDs = buildExistingMessagesString(mbID);
|
||||
|
||||
Cursor c = null;
|
||||
if (existingIDs.length() > 0) {
|
||||
c = (new SmsDataProvider(_context)).query(mbURI, "_id NOT IN (" + existingIDs + ")");
|
||||
}
|
||||
else {
|
||||
c = (new SmsDataProvider(_context)).query(mbURI);
|
||||
}
|
||||
|
||||
// Reading mailbox
|
||||
if (c != null && c.getCount() > 0) {
|
||||
c.moveToFirst();
|
||||
do {
|
||||
JSONObject entry = new JSONObject();
|
||||
|
||||
try {
|
||||
for(int idx=0;idx<c.getColumnCount();idx++) {
|
||||
String colName = c.getColumnName(idx);
|
||||
|
||||
// Id column is must be an integer
|
||||
if (colName.equals(new String("_id")) ||
|
||||
colName.equals(new String("type"))) {
|
||||
entry.put(colName, c.getInt(idx));
|
||||
}
|
||||
// Seen and read must be pseudo boolean
|
||||
else if (colName.equals(new String("read")) ||
|
||||
colName.equals(new String("seen"))) {
|
||||
entry.put(colName, c.getInt(idx) > 0 ? "true" : "false");
|
||||
}
|
||||
else {
|
||||
// Special case for date, we need to record last without searching
|
||||
if (colName.equals(new String("date"))) {
|
||||
final Long tmpDate = c.getLong(idx);
|
||||
if (tmpDate > _lastMsgDate) {
|
||||
_lastMsgDate = tmpDate;
|
||||
}
|
||||
}
|
||||
entry.put(colName, c.getString(idx));
|
||||
}
|
||||
}
|
||||
|
||||
// Mailbox ID is required by server
|
||||
entry.put("mbox", mbID.ordinal());
|
||||
|
||||
_jsonDataDump.put(entry);
|
||||
|
||||
} catch (JSONException e) {
|
||||
Log.e(TAG, "JSON Exception when reading SMS Mailbox", e);
|
||||
c.close();
|
||||
}
|
||||
}
|
||||
while(c.moveToNext());
|
||||
|
||||
Log.d(TAG, c.getCount() + " messages read from " + mbURI);
|
||||
|
||||
c.close();
|
||||
}
|
||||
}
|
||||
|
||||
// Used by Content Observer
|
||||
public JSONArray getLastMessage(MailboxID mbID) {
|
||||
String mbURI = mapMailboxIDToURI(mbID);
|
||||
|
||||
if (_context == null || mbURI == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Fetch Sent SMS Message from Built-in Content Provider
|
||||
Cursor c = (new SmsDataProvider(_context)).query(mbURI);
|
||||
|
||||
c.moveToNext();
|
||||
|
||||
// We create a list of strings to store results
|
||||
JSONArray results = new JSONArray();
|
||||
|
||||
JSONObject entry = new JSONObject();
|
||||
|
||||
try {
|
||||
Integer mboxId = -1;
|
||||
for(int idx = 0;idx < c.getColumnCount(); idx++) {
|
||||
String colName = c.getColumnName(idx);
|
||||
|
||||
// Id column is must be an integer
|
||||
if (colName.equals(new String("_id"))) {
|
||||
entry.put(colName, c.getInt(idx));
|
||||
}
|
||||
// Seen and read must be pseudo boolean
|
||||
else if (colName.equals(new String("read")) ||
|
||||
colName.equals(new String("seen"))) {
|
||||
entry.put(colName, c.getInt(idx) > 0 ? "true" : "false");
|
||||
}
|
||||
else if (colName.equals(new String("type"))) {
|
||||
mboxId = c.getInt(idx);
|
||||
entry.put(colName, c.getInt(idx));
|
||||
}
|
||||
else {
|
||||
entry.put(colName, c.getString(idx));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Mailbox ID is required by server
|
||||
* mboxId is greater than server mboxId by 1 because types
|
||||
* aren't indexed in the same mean
|
||||
*/
|
||||
entry.put("mbox", (mboxId - 1));
|
||||
|
||||
results.put(entry);
|
||||
} catch (JSONException e) {
|
||||
Log.e(TAG, "JSON Exception when reading SMS Mailbox", e);
|
||||
c.close();
|
||||
}
|
||||
|
||||
c.close();
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
// Used by ConnectivityChanged Event
|
||||
public JSONArray bufferizeMessagesSinceDate(Long sinceDate) {
|
||||
_jsonDataDump = new JSONArray();
|
||||
bufferizeMessagesSinceDate(MailboxID.INBOX, sinceDate);
|
||||
bufferizeMessagesSinceDate(MailboxID.SENT, sinceDate);
|
||||
bufferizeMessagesSinceDate(MailboxID.DRAFTS, sinceDate);
|
||||
return _jsonDataDump;
|
||||
}
|
||||
|
||||
// Used by ConnectivityChanged Event
|
||||
public void bufferizeMessagesSinceDate(MailboxID mbID, Long sinceDate) {
|
||||
String mbURI = mapMailboxIDToURI(mbID);
|
||||
|
||||
if (_context == null || mbURI == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Cursor c = new SmsDataProvider(_context).query(mbURI, "date > ?", new String[] { sinceDate.toString() });
|
||||
|
||||
// Reading mailbox
|
||||
if (c != null && c.getCount() > 0) {
|
||||
c.moveToFirst();
|
||||
do {
|
||||
JSONObject entry = new JSONObject();
|
||||
|
||||
try {
|
||||
for(int idx=0;idx<c.getColumnCount();idx++) {
|
||||
String colName = c.getColumnName(idx);
|
||||
|
||||
// Id column is must be an integer
|
||||
if (colName.equals(new String("_id")) ||
|
||||
colName.equals(new String("type"))) {
|
||||
entry.put(colName, c.getInt(idx));
|
||||
|
||||
// bufferize Id for future use
|
||||
if (colName.equals(new String("_id"))) {
|
||||
}
|
||||
}
|
||||
// Seen and read must be pseudo boolean
|
||||
else if (colName.equals(new String("read")) ||
|
||||
colName.equals(new String("seen"))) {
|
||||
entry.put(colName, c.getInt(idx) > 0 ? "true" : "false");
|
||||
}
|
||||
else {
|
||||
// Special case for date, we need to record last without searching
|
||||
if (colName.equals(new String("date"))) {
|
||||
final Long tmpDate = c.getLong(idx);
|
||||
if (tmpDate > _lastMsgDate) {
|
||||
_lastMsgDate = tmpDate;
|
||||
}
|
||||
}
|
||||
entry.put(colName, c.getString(idx));
|
||||
}
|
||||
}
|
||||
|
||||
// Mailbox ID is required by server
|
||||
entry.put("mbox", mbID.ordinal());
|
||||
|
||||
_jsonDataDump.put(entry);
|
||||
|
||||
} catch (JSONException e) {
|
||||
Log.e(TAG, "JSON Exception when reading SMS Mailbox", e);
|
||||
c.close();
|
||||
}
|
||||
}
|
||||
while(c.moveToNext());
|
||||
|
||||
Log.d(TAG, c.getCount() + " messages read from " + mbURI);
|
||||
|
||||
c.close();
|
||||
}
|
||||
}
|
||||
|
||||
private String mapMailboxIDToURI(MailboxID mbID) {
|
||||
if (mbID == MailboxID.INBOX) {
|
||||
return "content://sms/inbox";
|
||||
}
|
||||
else if (mbID == MailboxID.DRAFTS) {
|
||||
return "content://sms/drafts";
|
||||
}
|
||||
else if (mbID == MailboxID.SENT) {
|
||||
return "content://sms/sent";
|
||||
}
|
||||
else if (mbID == MailboxID.ALL) {
|
||||
return "content://sms";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private String buildExistingMessagesString(MailboxID _mbID) {
|
||||
JSONArray existingMessages = null;
|
||||
if (_mbID == MailboxID.INBOX) {
|
||||
existingMessages = _existingInboxMessages;
|
||||
} else if (_mbID == MailboxID.DRAFTS) {
|
||||
existingMessages = _existingDraftsMessages;
|
||||
} else if (_mbID == MailboxID.SENT) {
|
||||
existingMessages = _existingSentMessages;
|
||||
}
|
||||
// Note: The default case isn't possible, we check the mailbox before
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (existingMessages != null) {
|
||||
int len = existingMessages.length();
|
||||
for (int i = 0; i < len; i++) {
|
||||
try {
|
||||
if (sb.length() > 0) {
|
||||
sb.append(",");
|
||||
}
|
||||
sb.append(existingMessages.getInt(i));
|
||||
} catch (JSONException e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public void setExistingInboxMessages(JSONArray inboxMessages) {
|
||||
_existingInboxMessages = inboxMessages;
|
||||
}
|
||||
|
||||
public void setExistingSentMessages(JSONArray sentMessages) {
|
||||
_existingSentMessages = sentMessages;
|
||||
}
|
||||
|
||||
public void setExistingDraftsMessages(JSONArray draftMessages) {
|
||||
_existingDraftsMessages = draftMessages;
|
||||
}
|
||||
|
||||
public Long getLastMessageDate() {
|
||||
return _lastMsgDate;
|
||||
}
|
||||
|
||||
private Context _context;
|
||||
private JSONArray _jsonDataDump;
|
||||
private JSONArray _existingInboxMessages;
|
||||
private JSONArray _existingSentMessages;
|
||||
private JSONArray _existingDraftsMessages;
|
||||
|
||||
private Long _lastMsgDate;
|
||||
|
||||
private static final String TAG = SmsFetcher.class.getSimpleName();
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package fr.unix_experience.owncloud_sms.enums;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
public enum LoginReturnCode {
|
||||
OK,
|
||||
INVALID_ADDR,
|
||||
HTTP_CONN_FAILED,
|
||||
CONN_FAILED,
|
||||
INVALID_LOGIN,
|
||||
UNKNOWN_ERROR,
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package fr.unix_experience.owncloud_sms.enums;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
public enum MailboxID {
|
||||
INBOX,
|
||||
SENT,
|
||||
DRAFTS,
|
||||
ALL,
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package fr.unix_experience.owncloud_sms.enums;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
public enum OCSMSNotificationType {
|
||||
SYNC,
|
||||
SYNC_FAILED,
|
||||
DEBUG,
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package fr.unix_experience.owncloud_sms.enums;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
public enum OCSyncErrorType {
|
||||
IO,
|
||||
PARSE,
|
||||
AUTH,
|
||||
SERVER_ERROR,
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package fr.unix_experience.owncloud_sms.exceptions;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import fr.unix_experience.owncloud_sms.enums.OCSyncErrorType;
|
||||
|
||||
public class OCSyncException extends Exception {
|
||||
/**
|
||||
* Serial, generated by Eclipse to be compliant with JAVA
|
||||
*/
|
||||
private static final long serialVersionUID = -4277316598892180792L;
|
||||
|
||||
public OCSyncException(int errorId, OCSyncErrorType errorType) {
|
||||
_errorId = errorId;
|
||||
_errorType = errorType;
|
||||
}
|
||||
|
||||
public int getErrorId() {
|
||||
return _errorId;
|
||||
}
|
||||
|
||||
public OCSyncErrorType getErrorType() {
|
||||
return _errorType;
|
||||
}
|
||||
|
||||
private int _errorId;
|
||||
private OCSyncErrorType _errorType;
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package fr.unix_experience.owncloud_sms.notifications;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import android.content.Context;
|
||||
import fr.nrz.androidlib.notifications.NrzNotification;
|
||||
import fr.unix_experience.owncloud_sms.R;
|
||||
import fr.unix_experience.owncloud_sms.enums.OCSMSNotificationType;
|
||||
|
||||
public class OCSMSNotificationManager {
|
||||
|
||||
public OCSMSNotificationManager(final Context context) {
|
||||
_context = context;
|
||||
_notification = new NrzNotification(_context, R.drawable.ic_stat_ocsms);
|
||||
}
|
||||
|
||||
public void setSyncProcessMsg() {
|
||||
createNotificationIfPossible(OCSMSNotificationType.SYNC,
|
||||
_context.getString(R.string.sync_title),
|
||||
_context.getString(R.string.sync_inprogress)
|
||||
);
|
||||
}
|
||||
|
||||
public void dropSyncProcessMsg() {
|
||||
_notification.cancelNotify(OCSMSNotificationType.SYNC.ordinal());
|
||||
}
|
||||
|
||||
public void setSyncErrorMsg(final String errMsg) {
|
||||
createNotificationIfPossible(OCSMSNotificationType.SYNC_FAILED,
|
||||
_context.getString(R.string.sync_title),
|
||||
_context.getString(R.string.fatal_error) + "\n" + errMsg
|
||||
);
|
||||
}
|
||||
|
||||
public void dropSyncErrorMsg() {
|
||||
_notification.cancelNotify(OCSMSNotificationType.SYNC_FAILED.ordinal());
|
||||
}
|
||||
|
||||
public void setDebugMsg(final String errMsg) {
|
||||
createNotificationIfPossible(OCSMSNotificationType.DEBUG,
|
||||
"DEBUG", errMsg
|
||||
);
|
||||
}
|
||||
|
||||
private void createNotificationIfPossible(final OCSMSNotificationType nType, final String nTitle, final String nMsg) {
|
||||
_notification.createNotify(nType.ordinal(), nTitle, nMsg);
|
||||
}
|
||||
|
||||
private final Context _context;
|
||||
private final NrzNotification _notification;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package fr.unix_experience.owncloud_sms.observers;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import org.json.JSONArray;
|
||||
|
||||
import fr.unix_experience.owncloud_sms.engine.ASyncSMSSync;
|
||||
import fr.unix_experience.owncloud_sms.engine.ConnectivityMonitor;
|
||||
import fr.unix_experience.owncloud_sms.engine.OCSMSOwnCloudClient;
|
||||
import fr.unix_experience.owncloud_sms.engine.SmsFetcher;
|
||||
import fr.unix_experience.owncloud_sms.enums.MailboxID;
|
||||
import android.content.Context;
|
||||
import android.database.ContentObserver;
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
|
||||
public class SmsObserver extends ContentObserver implements ASyncSMSSync {
|
||||
|
||||
public SmsObserver(Handler handler) {
|
||||
super(handler);
|
||||
}
|
||||
|
||||
public SmsObserver(Handler handler, Context ct) {
|
||||
super(handler);
|
||||
_context = ct;
|
||||
}
|
||||
|
||||
public void onChange(boolean selfChange) {
|
||||
super.onChange(selfChange);
|
||||
Log.d(TAG, "onChange SmsObserver");
|
||||
|
||||
SmsFetcher fetcher = new SmsFetcher(_context);
|
||||
JSONArray smsList = fetcher.getLastMessage(MailboxID.ALL);
|
||||
|
||||
ConnectivityMonitor cMon = new ConnectivityMonitor(_context);
|
||||
|
||||
// Synchronize if network is valid and there are SMS
|
||||
if (cMon.isValid() && smsList != null) {
|
||||
new SyncTask(_context, smsList).execute();
|
||||
}
|
||||
}
|
||||
|
||||
public void setContext(Context context) {
|
||||
_context = context;
|
||||
}
|
||||
|
||||
private Context _context;
|
||||
|
||||
private static final String TAG = OCSMSOwnCloudClient.class.getSimpleName();
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package fr.unix_experience.owncloud_sms.prefs;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import fr.nrz.androidlib.common.SharedPrefs;
|
||||
import fr.unix_experience.owncloud_sms.R;
|
||||
import fr.unix_experience.owncloud_sms.defines.DefaultPrefs;
|
||||
|
||||
public class OCSMSSharedPrefs extends SharedPrefs {
|
||||
|
||||
public OCSMSSharedPrefs(final Context context) {
|
||||
super(context, R.string.shared_preference_file);
|
||||
}
|
||||
|
||||
public void setLastMessageDate(final Long msgDate) {
|
||||
final SharedPreferences.Editor editor = _sPrefs.edit();
|
||||
editor.putLong(_context.getString(R.string.pref_lastmsgdate), msgDate);
|
||||
editor.commit();
|
||||
}
|
||||
|
||||
public Long getLastMessageDate() {
|
||||
return _sPrefs.getLong(_context.getString(R.string.pref_lastmsgdate), 0);
|
||||
}
|
||||
|
||||
public Boolean pushOnReceive() {
|
||||
return _sPrefs.getBoolean("push_on_receive", DefaultPrefs.pushOnReceive);
|
||||
}
|
||||
|
||||
public Boolean syncInWifi() {
|
||||
return _sPrefs.getBoolean("sync_wifi", DefaultPrefs.syncWifi);
|
||||
}
|
||||
|
||||
public Boolean syncIn2G() {
|
||||
return _sPrefs.getBoolean("sync_2g", DefaultPrefs.sync2G);
|
||||
}
|
||||
|
||||
public Boolean syncInGPRS() {
|
||||
return _sPrefs.getBoolean("sync_gprs", DefaultPrefs.syncGPRS);
|
||||
}
|
||||
|
||||
public Boolean syncIn3G() {
|
||||
return _sPrefs.getBoolean("sync_3g", DefaultPrefs.sync3G);
|
||||
}
|
||||
|
||||
public Boolean syncIn4G() {
|
||||
return _sPrefs.getBoolean("sync_4g", DefaultPrefs.sync4G);
|
||||
}
|
||||
|
||||
public Boolean syncInOtherModes() {
|
||||
return _sPrefs.getBoolean("sync_others", DefaultPrefs.syncOthers);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package fr.unix_experience.owncloud_sms.providers;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import android.content.ContentProvider;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
|
||||
public class SmsDataProvider extends ContentProvider {
|
||||
public SmsDataProvider () {}
|
||||
|
||||
public SmsDataProvider (final Context ct) {
|
||||
super();
|
||||
_context = ct;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public Cursor query(final String mailBox) {
|
||||
return query(Uri.parse(mailBox),
|
||||
new String[] { "read", "date", "address", "seen", "body", "_id", "type", },
|
||||
null, null, null
|
||||
);
|
||||
}
|
||||
|
||||
public Cursor query(final String mailBox, final String selection) {
|
||||
return query(Uri.parse(mailBox),
|
||||
new String[] { "read", "date", "address", "seen", "body", "_id", "type", },
|
||||
selection, null, null
|
||||
);
|
||||
}
|
||||
|
||||
public Cursor query(final String mailBox, final String selection, final String[] selectionArgs) {
|
||||
return query(Uri.parse(mailBox),
|
||||
new String[] { "read", "date", "address", "seen", "body", "_id", "type", },
|
||||
selection, selectionArgs, null
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cursor query(final Uri uri, final String[] projection, final String selection,
|
||||
final String[] selectionArgs, final String sortOrder) {
|
||||
if (_context != null && _context.getContentResolver() != null) {
|
||||
return _context.getContentResolver().query(uri, projection, selection, selectionArgs, sortOrder);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType(final Uri uri) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Uri insert(final Uri uri, final ContentValues values) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int delete(final Uri uri, final String selection, final String[] selectionArgs) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(final Uri uri, final ContentValues values, final String selection,
|
||||
final String[] selectionArgs) {
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
private Context _context;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package fr.unix_experience.owncloud_sms.sync_adapters;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
|
||||
public class SmsSlowSyncService extends Service {
|
||||
// Storage for an instance of the sync adapter
|
||||
private static SmsSyncAdapter _adapter = null;
|
||||
// Object to use as a thread-safe lock
|
||||
private static final Object sSyncAdapterLock = new Object();
|
||||
/*
|
||||
* Instantiate the sync adapter object.
|
||||
*/
|
||||
@Override
|
||||
public void onCreate() {
|
||||
/*
|
||||
* Create the sync adapter as a singleton.
|
||||
* Set the sync adapter as syncable
|
||||
* Disallow parallel syncs
|
||||
*/
|
||||
synchronized (sSyncAdapterLock) {
|
||||
if (_adapter == null) {
|
||||
_adapter = new SmsSyncAdapter(getApplicationContext(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Return an object that allows the system to invoke
|
||||
* the sync adapter.
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
/*
|
||||
* Get the object that allows external processes
|
||||
* to call onPerformSync(). The object is created
|
||||
* in the base class code when the SyncAdapter
|
||||
* constructors call super()
|
||||
*/
|
||||
return _adapter.getSyncAdapterBinder();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package fr.unix_experience.owncloud_sms.sync_adapters;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
import android.content.AbstractThreadedSyncAdapter;
|
||||
import android.content.ContentProviderClient;
|
||||
import android.content.Context;
|
||||
import android.content.SyncResult;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import fr.unix_experience.owncloud_sms.R;
|
||||
import fr.unix_experience.owncloud_sms.engine.OCSMSOwnCloudClient;
|
||||
import fr.unix_experience.owncloud_sms.enums.OCSyncErrorType;
|
||||
import fr.unix_experience.owncloud_sms.exceptions.OCSyncException;
|
||||
import fr.unix_experience.owncloud_sms.notifications.OCSMSNotificationManager;
|
||||
|
||||
public class SmsSyncAdapter extends AbstractThreadedSyncAdapter {
|
||||
|
||||
public SmsSyncAdapter(final Context context, final boolean autoInitialize) {
|
||||
super(context, autoInitialize);
|
||||
_accountMgr = AccountManager.get(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPerformSync(final Account account, final Bundle extras, final String authority,
|
||||
final ContentProviderClient provider, final SyncResult syncResult) {
|
||||
|
||||
final OCSMSNotificationManager nMgr = new OCSMSNotificationManager(getContext());
|
||||
|
||||
// Create client
|
||||
final String ocURI = _accountMgr.getUserData(account, "ocURI");
|
||||
if (ocURI == null) {
|
||||
nMgr.setSyncErrorMsg(getContext().getString(R.string.err_sync_account_unparsable));
|
||||
return;
|
||||
}
|
||||
|
||||
final Uri serverURI = Uri.parse(ocURI);
|
||||
nMgr.setSyncProcessMsg();
|
||||
|
||||
final OCSMSOwnCloudClient _client = new OCSMSOwnCloudClient(getContext(),
|
||||
serverURI, _accountMgr.getUserData(account, "ocLogin"),
|
||||
_accountMgr.getPassword(account));
|
||||
|
||||
try {
|
||||
// getServerAPI version
|
||||
Log.d(TAG,"Server API version: " + _client.getServerAPIVersion());
|
||||
|
||||
// and push datas
|
||||
_client.doPushRequest(null);
|
||||
nMgr.dropSyncErrorMsg();
|
||||
} catch (final OCSyncException e) {
|
||||
nMgr.setSyncErrorMsg(getContext().getString(e.getErrorId()));
|
||||
if (e.getErrorType() == OCSyncErrorType.IO) {
|
||||
syncResult.stats.numIoExceptions++;
|
||||
}
|
||||
else if (e.getErrorType() == OCSyncErrorType.PARSE) {
|
||||
syncResult.stats.numParseExceptions++;
|
||||
}
|
||||
else if (e.getErrorType() == OCSyncErrorType.AUTH) {
|
||||
syncResult.stats.numAuthExceptions++;
|
||||
}
|
||||
else {
|
||||
// UNHANDLED
|
||||
}
|
||||
}
|
||||
|
||||
nMgr.dropSyncProcessMsg();
|
||||
|
||||
}
|
||||
|
||||
private final AccountManager _accountMgr;
|
||||
|
||||
private static final String TAG = SmsSyncAdapter.class.getSimpleName();
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package fr.unix_experience.owncloud_sms.sync_adapters;
|
||||
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
|
||||
public class SmsSyncService extends Service {
|
||||
// Storage for an instance of the sync adapter
|
||||
private static SmsSyncAdapter _adapter = null;
|
||||
// Object to use as a thread-safe lock
|
||||
private static final Object sSyncAdapterLock = new Object();
|
||||
/*
|
||||
* Instantiate the sync adapter object.
|
||||
*/
|
||||
@Override
|
||||
public void onCreate() {
|
||||
/*
|
||||
* Create the sync adapter as a singleton.
|
||||
* Set the sync adapter as syncable
|
||||
* Disallow parallel syncs
|
||||
*/
|
||||
synchronized (sSyncAdapterLock) {
|
||||
if (_adapter == null) {
|
||||
_adapter = new SmsSyncAdapter(getApplicationContext(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Return an object that allows the system to invoke
|
||||
* the sync adapter.
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
/*
|
||||
* Get the object that allows external processes
|
||||
* to call onPerformSync(). The object is created
|
||||
* in the base class code when the SyncAdapter
|
||||
* constructors call super()
|
||||
*/
|
||||
return _adapter.getSyncAdapterBinder();
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 916 B |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 821 B |
|
After Width: | Height: | Size: 9.2 KiB |
|
After Width: | Height: | Size: 30 KiB |
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape>
|
||||
<corners android:radius="6dp" />
|
||||
<gradient
|
||||
android:startColor="#66b6df"
|
||||
android:endColor="#56a6cf"
|
||||
android:angle="270" />
|
||||
<padding
|
||||
android:left="10dp"
|
||||
android:top="10dp"
|
||||
android:right="10dp"
|
||||
android:bottom="10dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
<TextView
|
||||
android:id="@+id/accountname"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="20dp"
|
||||
android:textSize="18sp"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,122 @@
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
tools:context="fr.unix_experience.owncloud_sms.activities.LoginActivity" >
|
||||
|
||||
<!-- Login progress -->
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/login_progress"
|
||||
style="?android:attr/progressBarStyleLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/login_form"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/email_login_form"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ocsms_logo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/login_logo"
|
||||
android:contentDescription="@string/login_logo" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/oc_protocol"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:entries="@array/protocol_array">
|
||||
</Spinner>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/oc_server"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/prompt_serverURI"
|
||||
android:inputType="textUri" >
|
||||
<requestFocus />
|
||||
</EditText>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/oc_login"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/prompt_login"
|
||||
android:inputType="textEmailAddress"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/oc_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/prompt_password"
|
||||
android:imeActionId="@+id/oc_login"
|
||||
android:imeActionLabel="@string/action_sign_in_short"
|
||||
android:imeOptions="actionUnspecified"
|
||||
android:inputType="textPassword"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/oc_signin_button"
|
||||
style="?android:textAppearanceSmall"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/action_sign_in_short"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,33 @@
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
|
||||
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="fr.unix_experience.owncloud_sms.activities.MainActivity" />
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
<TextView
|
||||
android:id="@+id/contactname"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="20dp"
|
||||
android:textSize="18sp"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,140 @@
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
tools:context="fr.unix_experience.owncloud_sms.MainActivity$PlaceholderFragment" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/main_tv_accounts"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:text="@string/ma_title_add_account"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/main_button_accounts"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/main_tv_accounts"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="26dp"
|
||||
android:onClick="openAddAccount"
|
||||
android:background="@drawable/standard_button"
|
||||
style="@style/StandardButton"
|
||||
android:text="@string/ma_button_goto_sync" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/main_tv_accounts"
|
||||
android:layout_alignStart="@+id/main_tv_accounts"
|
||||
android:layout_below="@+id/main_button_accounts"
|
||||
android:layout_marginTop="18dp"
|
||||
android:text="@string/ma_title_change_settings"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/main_button_settings"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/textView1"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="19dp"
|
||||
android:onClick="openAppSettings"
|
||||
android:background="@drawable/standard_button"
|
||||
style="@style/StandardButton"
|
||||
android:text="@string/ma_button_goto_settings" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_launchsync"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/main_tv_accounts"
|
||||
android:layout_alignStart="@+id/main_tv_accounts"
|
||||
android:layout_below="@+id/main_button_settings"
|
||||
android:layout_marginTop="18dp"
|
||||
android:text="@string/ma_title_sync_all"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/main_button_sync"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/tv_launchsync"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="19dp"
|
||||
android:onClick="syncAllMessages"
|
||||
android:background="@drawable/standard_button"
|
||||
style="@style/StandardButton"
|
||||
android:text="@string/ma_button_sync_accounts_now" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_remoteaccount"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/main_tv_accounts"
|
||||
android:layout_alignStart="@+id/main_tv_accounts"
|
||||
android:layout_below="@+id/main_button_sync"
|
||||
android:layout_marginTop="18dp"
|
||||
android:text="@string/ma_title_remote_account"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/main_button_choose_account"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/tv_remoteaccount"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="19dp"
|
||||
android:onClick="selectRemoteAccount"
|
||||
android:background="@drawable/standard_button"
|
||||
style="@style/StandardButton"
|
||||
android:text="@string/choose_account" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/textView1"
|
||||
android:layout_alignStart="@+id/textView1"
|
||||
android:layout_below="@+id/main_button_sync"
|
||||
android:layout_marginTop="33dp"
|
||||
android:src="@drawable/next_arrow" />
|
||||
<!-- android:layout_below="@+id/main_button_choose_account" -->
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,73 @@
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
tools:context="fr.unix_experience.owncloud_sms.MainActivity$PlaceholderFragment" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/section_label"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/main_title_welcome"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:text="@string/ma_title_welcome"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/main_tv_welcome"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/section_label"
|
||||
android:layout_alignStart="@+id/section_label"
|
||||
android:layout_below="@+id/section_label"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/ma_content_welcome"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:maxHeight="@dimen/arrow_max_height"
|
||||
android:src="@drawable/next_arrow" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,93 @@
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="@dimen/activity_vertical_margin"
|
||||
android:paddingLeft="@dimen/activity_horizontal_margin"
|
||||
android:paddingRight="@dimen/activity_horizontal_margin"
|
||||
android:paddingTop="@dimen/activity_vertical_margin"
|
||||
tools:context="fr.unix_experience.owncloud_sms.MainActivity$PlaceholderFragment" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title_thanksto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:text="@string/ma_button_thanksto"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_thankspeople"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_below="@+id/tv_title_thanksto"
|
||||
android:layout_marginTop="15dp"
|
||||
android:text="@string/ma_thanksto_people"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/button_rateus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/tv_rateUs"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="15dp"
|
||||
android:minHeight="36dp"
|
||||
android:text="@string/ma_button_rate_us"
|
||||
android:onClick="openGooglePlayStore"
|
||||
android:background="@drawable/standard_button"
|
||||
style="@style/StandardButton"
|
||||
android:textAlignment="center" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ma_title_rateus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/tv_thankspeople"
|
||||
android:layout_alignStart="@+id/tv_rateUs"
|
||||
android:layout_below="@+id/tv_thankspeople"
|
||||
android:layout_marginTop="25dp"
|
||||
android:text="@string/ma_title_rate_us"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_rateUs"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_below="@+id/ma_title_rateus"
|
||||
android:text="@string/ma_content_rate_us"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,39 @@
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" >
|
||||
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:drawSelectorOnTop="false" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,39 @@
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" >
|
||||
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:drawSelectorOnTop="false" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
<!-- Translation version, reference for translators -->
|
||||
<string name="gp_translation_version">3</string>
|
||||
|
||||
<!-- Translations must begin here -->
|
||||
<string name="gp_short_description">ownCloud SMS synchronizuje vaše lokální SMS zprávy na váš server ownCloud</string>
|
||||
<string name="gp_description">
|
||||
Aplikace ownCloud SMS synchronizuje vaše SMS zprávy na vzdálenou instanci ownCloud, kde si poté můžete zprávy přečíst.
|
||||
|
||||
Zasílání SMS ze serveru ownCloud bude doplněno v příštích vydáních.
|
||||
|
||||
Applikace je plně kompatibilní pro Android 4.0 až 5.0
|
||||
</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
|
||||
<!-- Translation version, reference for translators -->
|
||||
<string name="translation_version">5</string>
|
||||
|
||||
<!-- Translations must begin there -->
|
||||
<!-- Preferences -->
|
||||
<string name="pref_title_sync">SMS - rychle</string>
|
||||
<string name="pref_title_sync_frequency">Frekvence rychlé synchronizace</string>
|
||||
<string name="pref_title_slow_sync">SMS - pomalu a bezpečně</string>
|
||||
<string name="pref_title_slow_sync_frequency">Frekvence bezpečné pomalé synchronizace</string>
|
||||
<string name="action_settings">Nastavení</string>
|
||||
<string name="sync_now">Synchronizovat teď</string>
|
||||
<string name="pref_category_sync">Synchronizace</string>
|
||||
<string name="title_global_pref_to_general_prefs">Všeobecné možnosti</string>
|
||||
<string name="summary_global_pref_to_general_prefs">Možnosti synchronizace</string>
|
||||
<string name="summary_notif_prefs">Upozornění</string>
|
||||
<string name="pref_header_data_sync">Data a synchronizace</string>
|
||||
<string name="title_activity_general_settings">Hlavní nastavení</string>
|
||||
|
||||
<string-array name="pref_sync_frequency_titles">
|
||||
<item>5 minut</item>
|
||||
<item>15 minut</item>
|
||||
<item>30 minut</item>
|
||||
<item>1 hodina</item>
|
||||
<item>3 hodiny</item>
|
||||
<item>6 hodin</item>
|
||||
<item>12 hodin</item>
|
||||
<item>24 hodin</item>
|
||||
<item>Nikdy</item>
|
||||
</string-array>
|
||||
<string-array name="pref_sync_frequency_values">
|
||||
<item>5</item>
|
||||
<item>15</item>
|
||||
<item>30</item>
|
||||
<item>60</item>
|
||||
<item>180</item>
|
||||
<item>360</item>
|
||||
<item>720</item>
|
||||
<item>1440</item>
|
||||
<item>-1</item>
|
||||
</string-array>
|
||||
<string-array name="pref_slow_sync_frequency_titles">
|
||||
<item>1 hodina</item>
|
||||
<item>3 hodiny</item>
|
||||
<item>6 hodin</item>
|
||||
<item>12 hodin</item>
|
||||
<item>24 hodin</item>
|
||||
<item>Nikdy</item>
|
||||
</string-array>
|
||||
<string-array name="pref_slow_sync_frequency_values">
|
||||
<item>60</item>
|
||||
<item>180</item>
|
||||
<item>360</item>
|
||||
<item>720</item>
|
||||
<item>1440</item>
|
||||
<item>-1</item>
|
||||
</string-array>
|
||||
|
||||
<string name="title_activity_login">Přihlášení</string>
|
||||
|
||||
<!-- Login -->
|
||||
<string name="prompt_login">Login</string>
|
||||
<string name="prompt_password">Heslo</string>
|
||||
<string name="action_sign_in">Přihlásit se nebo registrovat</string>
|
||||
<string name="action_sign_in_short">Přihlášení</string>
|
||||
<string name="error_invalid_login">Nesprávné jméno nebo heslo</string>
|
||||
<string name="error_invalid_password">Toto heslo je příliš krátké</string>
|
||||
<string name="error_field_required">Toto pole je vyžadováno</string>
|
||||
<string name="prompt_serverURI">Adresa serveru</string>
|
||||
<string name="error_invalid_server_address">Neplatná adresa serveru</string>
|
||||
<string name="error_connection_failed">Připojení selhalo, ujistěte se, že máte správný server</string>
|
||||
<string name="error_http_connection_failed">Nelze provést připojení přes HTTP. Ujistěte se, že je webový server dostupný</string>
|
||||
|
||||
<string-array name="protocol_array">
|
||||
<item>https://</item>
|
||||
<item>http://</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Main activity -->
|
||||
<string name="ma_button_rate_us">Ohodnoťit!</string>
|
||||
<string name="ma_button_thanksto">Poděkování</string>
|
||||
<string name="ma_title_rate_us">Ohodnoťit!</string>
|
||||
<string name="ma_content_rate_us">Pokud se vám tato aplikace líbí, ohodnoťte ji v Obchodě Google Play</string>
|
||||
<string name="ma_title_add_account">Přidat účet</string>
|
||||
<string name="ma_button_goto_sync">Přejít na Účty a synchronizaci</string>
|
||||
<string name="ma_title_change_settings">Změnit nastavení aplikace</string>
|
||||
<string name="ma_button_goto_settings">Přejít do Nastavení</string>
|
||||
<string name="ma_title_welcome">Vítejte</string>
|
||||
<string name="ma_content_welcome">Vítejte v aplikaci ownCloud SMS. Tato aplikace umožnuje sychronizovat SMS do vašeho účtu na serveru ownCloud za pomoci aplikace pro SMS.</string>
|
||||
<string name="ma_thanksto_people">ownCloud vývojáři\n\ přispěvatelé a ti co hlásí chyby</string>
|
||||
|
||||
<!-- Notifications -->
|
||||
<string name="sync_title">Proces synchronizace</string>
|
||||
<string name="sync_inprogress">Probíhá synchronizace...</string>
|
||||
<string name="fatal_error">Chyba !</string>
|
||||
|
||||
<!-- Errors -->
|
||||
<string name="err_sync_get_smslist">Chyba #1: Přijata neplatná data ze serveru při přijímání předchozích zpráv</string>
|
||||
<string name="err_sync_craft_http_request">Chyba #2: Chyba při vytváření HTTP požadavku</string>
|
||||
<string name="err_sync_push_request">Chyba #3: Požadavek Push selhal</string>
|
||||
<string name="err_sync_push_request_resp">Chyba #4: Přijata neplatná data ze serveru při jejich odesílání</string>
|
||||
<string name="err_sync_create_json_null_smslist">Chyba #5: NULL SMS List</string>
|
||||
<string name="err_sync_create_json_put_smslist">Chyba #6: Chyba při vytváření Push požadavku</string>
|
||||
<string name="err_sync_create_json_request_encoding">Chyba #7: Nepodporované kódování při vytváření požadavku</string>
|
||||
<string name="err_sync_auth_failed">Chyba #8: Ověření selhalo</string>
|
||||
<string name="err_sync_http_request_returncode_unhandled">Chyba #9: Server nastavil neznámý HTTP kód odpovědi</string>
|
||||
<string name="err_sync_http_request_connect">Chyba #11: Nelze se připojit k ownCloud serveru</string>
|
||||
<string name="err_sync_http_request_httpexception">Chyba #12: Nelze se připojit k ownCloud serveru</string>
|
||||
<string name="err_sync_http_request_ioexception">Chyba #13: Nelze se připojit k ownCloud serveru</string>
|
||||
<string name="err_sync_http_request_resp">Chyba #14: Nelze zpracovat odpověď serveru</string>
|
||||
<string name="err_sync_http_request_parse_resp">Chyba #15: Nelze zpracovat odpověď serveru</string>
|
||||
<string name="err_sync_no_connection_available">Chyba #16: Není dostupné datové připojení</string>
|
||||
<string name="err_sync_account_unparsable">Chyba #17: účet poškozený Znovu nakonfigurovat</string>
|
||||
<string name="title_activity_main">MainActivity</string>
|
||||
<string name="title_section1">Sekce 1</string>
|
||||
<string name="title_section2">Sekce 2</string>
|
||||
<string name="title_section3">Sekce 3</string>
|
||||
<string name="title_activity_main_activity2">MainActivity2</string>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
<!-- Translation version, reference for translators -->
|
||||
<string name="gp_translation_version">3</string>
|
||||
|
||||
<!-- Translations must begin there -->
|
||||
<string name="gp_short_description">Mit ownCloud SMS kannst Du Deine SMS mit Deiner ownCloud synchronisieren</string>
|
||||
<string name="gp_description">
|
||||
Die ownCloud SMS App synchronisiert Deine SMS-Nachrichten mit einer ownCloud-Instanz und erlaubt Dir, die SMS dort zu lesen.
|
||||
|
||||
In kommenden Versionen soll auch den SMS-Versand von der ownCloud-Instanz aus möglich sein.
|
||||
Auf diese Weise wirst Du von überall in der Welt SMS versenden können, solange Dein Android-Smartphone GSM- und Datenempfang hat.
|
||||
|
||||
Die App ist vollständig kompatibel mit Android 4.0 bis 5.0
|
||||
</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,133 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
<!-- Translation version, reference for translators -->
|
||||
<string name="translation_version">2</string>
|
||||
|
||||
<!-- Translations must begin there -->
|
||||
<!-- Preferences -->
|
||||
<string name="pref_title_sync">SMS - Schnell</string>
|
||||
<string name="pref_title_sync_frequency">Schnelle Sync-Frequenz</string>
|
||||
<string name="pref_title_slow_sync">SMS - Langsam & Sicher</string>
|
||||
<string name="pref_title_slow_sync_frequency">Langsame Sync-Frequenz</string>
|
||||
<string name="action_settings">Einstellungen</string>
|
||||
<string name="sync_now">Jetzt synchronisieren</string>
|
||||
<string name="pref_category_sync">Synchronisierung</string>
|
||||
|
||||
<string name="title_global_pref_to_general_prefs">Allg. Einstellungen</string>
|
||||
<string name="summary_global_pref_to_general_prefs">Sync-Einstellungen</string>
|
||||
<string name="summary_notif_prefs">Benachrichtigungen</string>
|
||||
|
||||
<string name="pref_header_data_sync">Daten & Sync</string>
|
||||
|
||||
<string name="title_activity_general_settings">Allg. Einstellungen</string>
|
||||
|
||||
<string-array name="pref_sync_frequency_titles">
|
||||
<item>5 Minuten</item>
|
||||
<item>15 Minuten</item>
|
||||
<item>30 Minuten</item>
|
||||
<item>1 Stunde</item>
|
||||
<item>3 Stunden</item>
|
||||
<item>6 Stunden</item>
|
||||
<item>12 Stunden</item>
|
||||
<item>24 Stunden</item>
|
||||
<item>Nie</item>
|
||||
</string-array>
|
||||
<string-array name="pref_sync_frequency_values">
|
||||
<item>5</item>
|
||||
<item>15</item>
|
||||
<item>30</item>
|
||||
<item>60</item>
|
||||
<item>180</item>
|
||||
<item>360</item>
|
||||
<item>720</item>
|
||||
<item>1440</item>
|
||||
<item>-1</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pref_slow_sync_frequency_titles">
|
||||
<item>1 Stunde</item>
|
||||
<item>3 Stunden</item>
|
||||
<item>6 Stunden</item>
|
||||
<item>12 Stunden</item>
|
||||
<item>24 Stunden</item>
|
||||
<item>Nie</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pref_slow_sync_frequency_values">
|
||||
<item>60</item>
|
||||
<item>180</item>
|
||||
<item>360</item>
|
||||
<item>720</item>
|
||||
<item>1440</item>
|
||||
<item>-1</item>
|
||||
</string-array>
|
||||
|
||||
<string name="title_activity_login">Einloggen</string>
|
||||
|
||||
<!-- Login -->
|
||||
<string name="prompt_login">Login</string>
|
||||
<string name="prompt_password">Passwort</string>
|
||||
<string name="action_sign_in">Einloggen oder Registrieren</string>
|
||||
<string name="action_sign_in_short">Einloggen</string>
|
||||
<string name="error_invalid_login">Falscher Benutzername oder Passwort</string>
|
||||
<string name="error_invalid_password">Dieses Passwort ist zu kurz</string>
|
||||
<string name="error_field_required">Pflichtfeld</string>
|
||||
<string name="prompt_serverURI">Server-Adresse</string>
|
||||
<string name="error_invalid_server_address">Ungültige Serveradresse</string>
|
||||
<string name="error_connection_failed">Verbindung fehlgeschlagen, ist dies der richtige Server?</string>
|
||||
<string name="error_http_connection_failed">Kann keine HTTP-Verbindung aufbauen. Läuft der Webserver unter dieser Adresse?</string>
|
||||
|
||||
<string-array name="protocol_array">
|
||||
<item>https://</item>
|
||||
<item>http://</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Notifications -->
|
||||
<string name="sync_title">Synchronisation</string>
|
||||
<string name="sync_inprogress">Sychronisation läuft...</string>
|
||||
<string name="fatal_error">Kritischer Fehler!</string>
|
||||
|
||||
|
||||
<!-- Errors -->
|
||||
<string name="err_sync_get_smslist">Fehler #1: Bei vorherigen Nachrichten ungültige Serverdaten empfangen</string>
|
||||
<string name="err_sync_craft_http_request">Fehler #2: Fehler bei der Erstellung des HTTP-Requests</string>
|
||||
<string name="err_sync_push_request">Fehler #3: Push-Request fehlgeschlagen</string>
|
||||
<string name="err_sync_push_request_resp">Fehler #4: Beim Pushen von Daten ungültige Serverdaten empfangen</string>
|
||||
<string name="err_sync_create_json_null_smslist">Fehler #5: SMS-Liste gab NULL zurück</string>
|
||||
<string name="err_sync_create_json_put_smslist">Fehler #6: Fehler bei der Erstellung des Push-Requests</string>
|
||||
<string name="err_sync_create_json_request_encoding">Fehler #7: Ungültige Zeichenkodierung bei der Erstellung des Requests</string>
|
||||
<string name="err_sync_auth_failed">Fehler #8: Anmeldung fehlgeschlagen</string>
|
||||
<string name="err_sync_http_request_returncode_unhandled">Fehler #9: Unbekannter HTTP-Antwortcode vom Server</string>
|
||||
<string name="err_sync_http_request_connect">Fehler #11: Konnte nicht mit der ownCloud-Instanz verbinden (HTTP-Request)</string>
|
||||
<string name="err_sync_http_request_httpexception">Fehler #12: Konnte nicht mit der ownCloud-Instanz verbinden (HTTP-Ausnahme)</string>
|
||||
<string name="err_sync_http_request_ioexception">Fehler #13: Konnte nicht mit der ownCloud-Instanz verbinden (IO-Fehler)</string>
|
||||
<string name="err_sync_http_request_resp">Fehler #14: Konnte Server-Antwort nicht parsen</string>
|
||||
<string name="err_sync_http_request_parse_resp">Fehler #15: Konnte Server-Antwort nicht parsen</string>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
<!-- Translation version, reference for translators -->
|
||||
<string name="gp_translation_version">3</string>
|
||||
|
||||
<!-- Translations must begin here -->
|
||||
<string name="gp_short_description">ownCloud SMS synchronize your local SMS on your ownCloud instance</string>
|
||||
<string name="gp_description">
|
||||
ownCloud SMS application synchronize your SMS messages on a remote ownCloud instance and let you read your messages from it.
|
||||
|
||||
Sending SMS from ownCloud instance will coming in a future release.
|
||||
|
||||
Application is fully compatible from Android 4.0 to 5.0
|
||||
</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,162 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
<!-- Translation version, reference for translators -->
|
||||
<string name="translation_version">7</string>
|
||||
|
||||
<!-- Translations must begin there -->
|
||||
<!-- Preferences -->
|
||||
<string name="pref_title_sync">Fast Sync</string>
|
||||
<string name="pref_title_sync_frequency">Fast Sync frequency</string>
|
||||
<string name="pref_title_slow_sync">Secure Slow Sync</string>
|
||||
<string name="pref_title_slow_sync_frequency">Secure Slow Sync frequency</string>
|
||||
|
||||
<string name="action_settings">Settings</string>
|
||||
<string name="sync_now">Synchronize now</string>
|
||||
<string name="pref_category_sync">Synchronization</string>
|
||||
|
||||
<string name="title_global_pref_to_general_prefs">General preferences</string>
|
||||
<string name="summary_global_pref_to_general_prefs">Sync options</string>
|
||||
<string name="summary_notif_prefs">Notifications</string>
|
||||
|
||||
<string name="pref_header_data_sync">Data & sync</string>
|
||||
|
||||
<string name="title_activity_general_settings">General Settings</string>
|
||||
|
||||
<string-array name="pref_sync_frequency_titles">
|
||||
<item>5 minutes</item>
|
||||
<item>15 minutes</item>
|
||||
<item>30 minutes</item>
|
||||
<item>1 hour</item>
|
||||
<item>3 hours</item>
|
||||
<item>6 hours</item>
|
||||
<item>12 hours</item>
|
||||
<item>24 hours</item>
|
||||
<item>Never</item>
|
||||
</string-array>
|
||||
<string-array name="pref_sync_frequency_values">
|
||||
<item>5</item>
|
||||
<item>15</item>
|
||||
<item>30</item>
|
||||
<item>60</item>
|
||||
<item>180</item>
|
||||
<item>360</item>
|
||||
<item>720</item>
|
||||
<item>1440</item>
|
||||
<item>-1</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pref_slow_sync_frequency_titles">
|
||||
<item>1 minute</item>
|
||||
<item>1 hour</item>
|
||||
<item>3 hours</item>
|
||||
<item>6 hours</item>
|
||||
<item>12 hours</item>
|
||||
<item>24 hours</item>
|
||||
<item>Never</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="pref_slow_sync_frequency_values">
|
||||
<item>1</item>
|
||||
<item>60</item>
|
||||
<item>180</item>
|
||||
<item>360</item>
|
||||
<item>720</item>
|
||||
<item>1440</item>
|
||||
<item>-1</item>
|
||||
</string-array>
|
||||
|
||||
<string name="pref_push_on_receive">Push SMS on reception</string>
|
||||
<string name="pref_sync_wifi">Synchronize in Wi-Fi</string>
|
||||
<string name="pref_sync_4g">Synchronize in 4G</string>
|
||||
<string name="pref_sync_3g">Synchronize in 3G</string>
|
||||
<string name="pref_sync_gprs">Synchronize in 2.5G (GPRS)</string>
|
||||
<string name="pref_sync_2g">Synchronize in 2G</string>
|
||||
<string name="pref_sync_others">Synchronize in other modes</string>
|
||||
|
||||
<string name="title_activity_login">Sign in</string>
|
||||
|
||||
<!-- Login -->
|
||||
<string name="prompt_login">Login</string>
|
||||
<string name="prompt_password">Password </string>
|
||||
<string name="action_sign_in">Sign in or register</string>
|
||||
<string name="action_sign_in_short">Sign in</string>
|
||||
<string name="error_invalid_login">Login or password incorrect</string>
|
||||
<string name="error_invalid_password">This password is too short</string>
|
||||
<string name="error_field_required">This field is required</string>
|
||||
<string name="prompt_serverURI">Server address</string>
|
||||
<string name="error_invalid_server_address">Invalid server address</string>
|
||||
<string name="error_connection_failed">Connection failed, ensure this is the right server</string>
|
||||
<string name="error_http_connection_failed">Unable to perform a HTTP connection. Please ensure there is a web server</string>
|
||||
|
||||
<string-array name="protocol_array">
|
||||
<item>https://</item>
|
||||
<item>http://</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Main activity -->
|
||||
<string name="ma_button_rate_us">Rate us !</string>
|
||||
<string name="ma_button_thanksto">Thanks to</string>
|
||||
<string name="ma_title_rate_us">Rate us !</string>
|
||||
<string name="ma_content_rate_us">If you like this application, please give rate us on Google Play Store</string>
|
||||
<string name="ma_title_add_account">Add an account</string>
|
||||
<string name="ma_button_goto_sync">Go to Accounts and Sync</string>
|
||||
<string name="ma_title_change_settings">Change app settings</string>
|
||||
<string name="ma_button_goto_settings">Go to Settings</string>
|
||||
<string name="ma_title_welcome">Welcome</string>
|
||||
<string name="ma_content_welcome">Welcome to ownCloud SMS application. This application let you synchronize your SMS to your ownCloud instance using SMS app.</string>
|
||||
<string name="ma_thanksto_people">ownCloud developers\n\
|
||||
Contributors and issue\'s reporters</string>
|
||||
<string name="ma_title_sync_all">Synchronize all messages</string>
|
||||
<string name="ma_button_sync_accounts_now">Launch synchronization now</string>
|
||||
|
||||
<!-- Notifications -->
|
||||
<string name="sync_title">Sync process</string>
|
||||
<string name="sync_inprogress">Sync in progress...</string>
|
||||
<string name="fatal_error">Fatal error ! </string>
|
||||
|
||||
<!-- Errors -->
|
||||
<string name="err_sync_get_smslist">Error #1: Invalid data received from server when getting previous messages</string>
|
||||
<string name="err_sync_craft_http_request">Error #2: Error while crafting HTTP request</string>
|
||||
<string name="err_sync_push_request">Error #3: Push request failed</string>
|
||||
<string name="err_sync_push_request_resp">Error #4: Invalid datas received from server when pushing datas</string>
|
||||
<string name="err_sync_create_json_null_smslist">Error #5: NULL Sms List</string>
|
||||
<string name="err_sync_create_json_put_smslist">Error #6: Error while crafting push request</string>
|
||||
<string name="err_sync_create_json_request_encoding">Error #7: Unsupported encoding when generating request</string>
|
||||
<string name="err_sync_auth_failed">Error #8: Authentication failed</string>
|
||||
<string name="err_sync_http_request_returncode_unhandled">Error #9: Server set unhandled HTTP return code</string>
|
||||
<string name="err_sync_http_request_connect">Error #11: Unable to perform a connection to ownCloud instance</string>
|
||||
<string name="err_sync_http_request_httpexception">Error #12: Unable to perform a connection to ownCloud instance</string>
|
||||
<string name="err_sync_http_request_ioexception">Error #13: Unable to perform a connection to ownCloud instance</string>
|
||||
<string name="err_sync_http_request_resp">Error #14: Unable to parse server response</string>
|
||||
<string name="err_sync_http_request_parse_resp">Error #15: Unable to parse server response</string>
|
||||
<string name="err_sync_no_connection_available">Error #16: No data connection available</string>
|
||||
<string name="err_sync_account_unparsable">Error #17: malformed account. Please reconfigure it</string>
|
||||
<string name="err_sync_ocsms_not_installed_or_oc_upgrade_required">Error #18: OcSMS app is not installed or ownCloud awaiting for an upgrade</string>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
<!-- Translation version, reference for translators -->
|
||||
<string name="gp_translation_version">0</string>
|
||||
<string name="gp_short_description">ownCloud SMS sincroniza sus mensajes SMS locales en su servidor ownCloud</string>
|
||||
<string name="gp_description">
|
||||
La aplicación ownCloud SMS sincroniza sus mensajes SMS en un servidor ownCloud remoto y le permite leer sus mensajes desde él.
|
||||
|
||||
El envio de SMS desde el servidor ownCloud será implementado en futuras versiones.
|
||||
|
||||
La aplicación es totalmente compatible con Android 4.0 a 5.0
|
||||
</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,94 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<!-- Translation version, reference for translators -->
|
||||
<string name="translation_version">1</string>
|
||||
|
||||
<!-- Translations must begin there -->
|
||||
<!-- Preferences -->
|
||||
<string name="pref_title_sync_frequency">Frecuencia de sincronización</string>
|
||||
<string name="action_settings">Configuración</string>
|
||||
<string name="sync_now">Sincronizar ahora</string>
|
||||
<string name="pref_category_sync">Sincronización</string>
|
||||
|
||||
<string name="title_global_pref_to_general_prefs">Preferencias generales</string>
|
||||
<string name="summary_global_pref_to_general_prefs">Opciones de sincronización</string>
|
||||
<string name="summary_notif_prefs">Notificaciones</string>
|
||||
|
||||
<string name="pref_header_data_sync">Sincronizar & datos</string>
|
||||
|
||||
<string name="title_activity_general_settings">Configuración general</string>
|
||||
|
||||
<string-array name="pref_sync_frequency_titles">
|
||||
<item>15 minutos</item>
|
||||
<item>30 minutos</item>
|
||||
<item>1 hora</item>
|
||||
<item>3 horas</item>
|
||||
<item>6 horas</item>
|
||||
<item>12 horas</item>
|
||||
<item>24 horas</item>
|
||||
<item>Nunca</item>
|
||||
</string-array>
|
||||
<string-array name="pref_sync_frequency_values">
|
||||
<item>15</item>
|
||||
<item>30</item>
|
||||
<item>60</item>
|
||||
<item>180</item>
|
||||
<item>360</item>
|
||||
<item>720</item>
|
||||
<item>1440</item>
|
||||
<item>-1</item>
|
||||
</string-array>
|
||||
|
||||
<string name="title_activity_login">Unirse</string>
|
||||
|
||||
<!-- Login -->
|
||||
<string name="prompt_login">Usuario</string>
|
||||
<string name="prompt_password">Contraseña</string>
|
||||
<string name="action_sign_in">Unirse o registrarse</string>
|
||||
<string name="action_sign_in_short">Unirse</string>
|
||||
<string name="error_invalid_login">Usuario o contraseña incorrecto</string>
|
||||
<string name="error_invalid_password">Contraseña demasiado corta</string>
|
||||
<string name="error_field_required">Campo requerido</string>
|
||||
<string name="prompt_serverURI">Dirección del servidor</string>
|
||||
<string name="error_invalid_server_address">Dirección inválida</string>
|
||||
<string name="error_connection_failed">Imposible conectar al servidor. Por favor asegúrese que la dirección del servidor es correcta</string>
|
||||
<string name="error_http_connection_failed">Imposible establecer una conexión HTTP. Por favor asegúrese que el servidor HTTP esta ejecutándose</string>
|
||||
|
||||
<string-array name="protocol_array">
|
||||
<item>https://</item>
|
||||
<item>http://</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Notifications -->
|
||||
<string name="sync_title">Proceso de sincronización</string>
|
||||
<string name="sync_inprogress">Sincronización en progreso...</string>
|
||||
<string name="fatal_error">Error Fatal ! </string>
|
||||
</resources>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
<!-- Translation version, reference for translators -->
|
||||
<string name="gp_translation_version">3</string>
|
||||
|
||||
<!-- Translations must begin there -->
|
||||
<string name="gp_short_description">ownCloud SMS permet de synchroniser vos SMS sur votre instance ownCloud</string>
|
||||
<string name="gp_description">
|
||||
L\'application ownCloud SMS vous permet de synchroniser vos messages SMS sur une instance ownCloud distante et ainsi de pouvoir les lire.
|
||||
|
||||
Il est prévu d\'ajouter le support de l\'envoi de SMS depuis l\'instance ownCloud dans une future mise à jour, vous permettant d\'envoyer des SMS depuis n\'importe où dans le monde, en laissant votre téléphone Android à portée d\'un accès DATA et GSM
|
||||
|
||||
L\'application est pleinement compatible des versions Android 4.0 à 5.0
|
||||
</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,121 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
<!-- Translation version, reference for translators -->
|
||||
<string name="translation_version">7</string>
|
||||
|
||||
<!-- Translations must begin there -->
|
||||
|
||||
<string name="app_name">ownCloud-SMS</string>
|
||||
<string name="action_settings">Paramètres</string>
|
||||
<string name="sync_now">Synchroniser maintenant</string>
|
||||
|
||||
<!-- Preferences -->
|
||||
<string name="pref_category_sync">Synchronisation</string>
|
||||
|
||||
<string name="title_global_pref_to_general_prefs">Préférences générales</string>
|
||||
<string name="summary_global_pref_to_general_prefs">Options de synchronisation</string>
|
||||
<string name="summary_notif_prefs">Notifications</string>
|
||||
|
||||
<string name="pref_header_data_sync">Données & synchronisation</string>
|
||||
<string name="pref_title_sync_frequency">Fréquence de synchronisation</string>
|
||||
<string name="pref_title_sync">SMS - Méthode rapide</string>
|
||||
<string name="pref_title_slow_sync">SMS - Méthode lente (sécurisée)</string>
|
||||
<string name="pref_title_slow_sync_frequency">Fréquence de la synchronisation lente</string>
|
||||
|
||||
<string name="title_activity_general_settings">Préférences générales</string>
|
||||
|
||||
<string-array name="pref_sync_frequency_titles">
|
||||
<item>15 minutes</item>
|
||||
<item>30 minutes</item>
|
||||
<item>1 heure</item>
|
||||
<item>3 heures</item>
|
||||
<item>6 heures</item>
|
||||
<item>12 heures</item>
|
||||
<item>24 heures</item>
|
||||
<item>Jamais</item>
|
||||
</string-array>
|
||||
<string-array name="pref_sync_frequency_values">
|
||||
<item>15</item>
|
||||
<item>30</item>
|
||||
<item>60</item>
|
||||
<item>180</item>
|
||||
<item>360</item>
|
||||
<item>720</item>
|
||||
<item>1440</item>
|
||||
<item>-1</item>
|
||||
</string-array>
|
||||
|
||||
<string name="pref_push_on_receive">Pousser le SMS à la réception</string>
|
||||
<string name="pref_sync_wifi">Synchroniser en Wi-Fi</string>
|
||||
<string name="pref_sync_4g">Synchroniser en 4G</string>
|
||||
<string name="pref_sync_3g">Synchroniser en 3G</string>
|
||||
<string name="pref_sync_gprs">Synchroniser en 2.5G (GPRS)</string>
|
||||
<string name="pref_sync_2g">Synchroniser en 2G</string>
|
||||
<string name="pref_sync_others">Synchroniser dans les autres modes</string>
|
||||
|
||||
<string name="title_activity_login">Connexion</string>
|
||||
|
||||
<!-- Login -->
|
||||
<string name="prompt_login">Identifiant</string>
|
||||
<string name="prompt_password">Mot de passe </string>
|
||||
<string name="action_sign_in">S\'enregistrer ou se connecter</string>
|
||||
<string name="action_sign_in_short">Se connecter</string>
|
||||
<string name="error_invalid_login">Identifiant ou mot de passe incorrect</string>
|
||||
<string name="error_invalid_password">Ce mot de passe est trop court</string>
|
||||
<string name="error_field_required">Ce champ est requis</string>
|
||||
<string name="prompt_serverURI">Adresse du serveur</string>
|
||||
<string name="error_invalid_server_address">Adresse invalide</string>
|
||||
<string name="error_connection_failed">Echec de connexion, assurer vous qu\'il s\'agit du bon serveur</string>
|
||||
<string name="error_http_connection_failed">Impossible d\'effectuer la connexion HTTP. Assurez vous qu\'il s\'agit d\'un serveur HTTP</string>
|
||||
|
||||
<!-- Main activity -->
|
||||
<string name="ma_button_rate_us">Notez nous !</string>
|
||||
<string name="ma_button_thanksto">Remerciements</string>
|
||||
<string name="ma_title_rate_us">Notez nous !</string>
|
||||
<string name="ma_content_rate_us">Si vous aimez cette application, n\'hésitez pas à nous noter sur le Google Play Store</string>
|
||||
<string name="ma_title_add_account">Ajouter un compte</string>
|
||||
<string name="ma_button_goto_sync">Ouvrir comptes et synchronisation</string>
|
||||
<string name="ma_title_change_settings">Changer les paramètres de l\'application</string>
|
||||
<string name="ma_button_goto_settings">Aller dans les paramètres</string>
|
||||
<string name="ma_title_welcome">Bienvenue</string>
|
||||
<string name="ma_content_welcome">Bienvenue sur l\'application ownCloud SMS. Cette application va vous permettre de synchroniser vos SMS au sein de votre instance ownCloud en utilisant l\'application dédiée.</string>
|
||||
<string name="ma_thanksto_people">L\'équipe de développement ownCloud\n\
|
||||
Les contributeurs et rapporteurs de bugs</string>
|
||||
<string name="ma_title_sync_all">Synchroniser tous les messages</string>
|
||||
<string name="ma_button_sync_accounts_now">Lancer la synchronisation</string>
|
||||
|
||||
<!-- Notifications -->
|
||||
<string name="sync_title">Processus de synchronisation</string>
|
||||
<string name="sync_inprogress">Synchonisation en cours...</string>
|
||||
<string name="fatal_error">Erreur fatale ! </string>
|
||||
|
||||
<string name="err_sync_no_connection_available">Erreur #16: Aucune connexion data disponible</string>
|
||||
<string name="err_sync_account_unparsable">Error #17: Compte mal configuré. Merci de bien vouloir le reconfigurer.</string>
|
||||
<string name="err_sync_ocsms_not_installed_or_oc_upgrade_required">Error #18: L\'application OcSMS n\'est pas installée ou ownCloud attend d\'être mis à niveau.</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
<!-- Translation version, reference for translators -->
|
||||
<string name="gp_translation_version">3</string>
|
||||
|
||||
<!-- Translations must begin here -->
|
||||
<string name="gp_short_description">Оунклауд СМС синхронизује ваше локалне СМС поруке на ваш Оунклауд налог</string>
|
||||
<string name="gp_description">
|
||||
Оунклауд СМС (ownCloud SMS) синхронизује ваше СМС поруке на ваш Оунклауд налог где можете да их читате.
|
||||
|
||||
Слање СМС-ова са Оунклауд налога ће доћи у неком од наредних издања.
|
||||
|
||||
Апликација је у потпуности компатибилна са Андроидима од 4.0 до 5.0
|
||||
</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,137 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
|
||||
<!-- Translation version, reference for translators -->
|
||||
<string name="translation_version">6</string>
|
||||
|
||||
<!-- In Serbian language there's a rule to transliterate app names -->
|
||||
<string name="app_name">Оунклауд-СМС</string>
|
||||
|
||||
<!-- Translations must begin there -->
|
||||
<!-- Preferences -->
|
||||
<string name="pref_title_sync">СМС — брзо</string>
|
||||
<string name="pref_title_sync_frequency">Учестаност брзе синх.</string>
|
||||
<string name="pref_title_slow_sync">СМС — споро и безбедно</string>
|
||||
<string name="pref_title_slow_sync_frequency">Учестаност споре, безбедне синх.</string>
|
||||
<string name="action_settings">Поставке</string>
|
||||
<string name="sync_now">Синхронизуј одмах</string>
|
||||
<string name="pref_category_sync">Синхронизација</string>
|
||||
<string name="title_global_pref_to_general_prefs">Опште поставке</string>
|
||||
<string name="summary_global_pref_to_general_prefs">Опције синхронизације</string>
|
||||
<string name="summary_notif_prefs">Обавештења</string>
|
||||
<string name="pref_header_data_sync">Подаци и синхронизација</string>
|
||||
<string name="title_activity_general_settings">Опште поставке</string>
|
||||
|
||||
<string-array name="pref_sync_frequency_titles">
|
||||
<item>5 минута</item>
|
||||
<item>15 минута</item>
|
||||
<item>30 минута</item>
|
||||
<item>1 сат</item>
|
||||
<item>3 сата</item>
|
||||
<item>6 сати</item>
|
||||
<item>12 сати</item>
|
||||
<item>24 сата</item>
|
||||
<item>Никад</item>
|
||||
</string-array>
|
||||
<string-array name="pref_slow_sync_frequency_titles">
|
||||
<item>1 сат</item>
|
||||
<item>3 сата</item>
|
||||
<item>6 сати</item>
|
||||
<item>12 сати</item>
|
||||
<item>24 сата</item>
|
||||
<item>Никад</item>
|
||||
</string-array>
|
||||
|
||||
<string name="pref_sync_wifi">Синх. преко бежичног</string>
|
||||
<string name="pref_sync_4g">Синх. преко 4G</string>
|
||||
<string name="pref_sync_3g">Синх. преко 3G</string>
|
||||
<string name="pref_sync_gprs">Синх. преко 2.5G (ГПРС)</string>
|
||||
<string name="pref_sync_2g">Синх. преко 2G</string>
|
||||
<string name="pref_sync_others">Синх. у осталим режимима</string>
|
||||
|
||||
<string name="title_activity_login">Пријављивање</string>
|
||||
|
||||
<!-- Login -->
|
||||
<string name="prompt_login">Корисничко име</string>
|
||||
<string name="prompt_password">Лозинка</string>
|
||||
<string name="action_sign_in">Пријавите се или региструјте</string>
|
||||
<string name="action_sign_in_short">Пријава</string>
|
||||
<string name="error_invalid_login">Корисничко име или лозинка нетачни</string>
|
||||
<string name="error_invalid_password">Ова лозинка је прекратка</string>
|
||||
<string name="error_field_required">Ово поље је обавезно</string>
|
||||
<string name="prompt_serverURI">Адреса сервера</string>
|
||||
<string name="error_invalid_server_address">Неисправна адреса сервера</string>
|
||||
<string name="error_connection_failed">Повезивање није успело, проверите да ли је ово прави сервер</string>
|
||||
<string name="error_http_connection_failed">Не могу да установим ХТТП везу. Проверите да ли веб сервер постоји</string>
|
||||
|
||||
<!-- Main activity -->
|
||||
<string name="ma_button_rate_us">Оцените!</string>
|
||||
<string name="ma_button_thanksto">Хвала</string>
|
||||
<string name="ma_title_rate_us">Оцените нас!</string>
|
||||
<string name="ma_content_rate_us">Ако вам се свиђа ова апликација оцените нас на Гугловој Плеј продавници</string>
|
||||
<string name="ma_title_add_account">Додајте налог</string>
|
||||
<string name="ma_button_goto_sync">Налози и синхронизација</string>
|
||||
<string name="ma_title_change_settings">Измените поставке апликације</string>
|
||||
<string name="ma_button_goto_settings">Поставке</string>
|
||||
<string name="ma_title_welcome">Добро дошли</string>
|
||||
<string name="ma_content_welcome">Добро дошли у Оунклауд СМС. Ова апликација синхронизује ваше СМС поруке на СМС апликацију вашег Оунклауд сервера.</string>
|
||||
<string name="ma_thanksto_people">Оунклауд програмерима\n\
|
||||
Доприносиоцима и људима који пријављују грешке</string>
|
||||
<string name="ma_title_sync_all">Синхронизујте све поруке</string>
|
||||
<string name="ma_button_sync_accounts_now">Почни синхронизацију сада</string>
|
||||
|
||||
<!-- Notifications -->
|
||||
<string name="sync_title">Синхронизација</string>
|
||||
<string name="sync_inprogress">Синхронизација у току...</string>
|
||||
<string name="fatal_error">Кобна грешка! </string>
|
||||
|
||||
<!-- Errors -->
|
||||
<string name="err_sync_get_smslist">Грешка #1: неисправни подаци примљени са сервера приликом добављања претходних порука</string>
|
||||
<string name="err_sync_craft_http_request">Грешка #2: грешка при изради ХТТП захтева</string>
|
||||
<string name="err_sync_push_request">Грешка #3: захтев за гурањем није успео</string>
|
||||
<string name="err_sync_push_request_resp">Грешка #4: неисправни подаци примљени са сервера приликом гурања података</string>
|
||||
<string name="err_sync_create_json_null_smslist">Грешка #5: празан списак СМС порука</string>
|
||||
<string name="err_sync_create_json_put_smslist">Грешка #6: грешка при изради захтева гурања</string>
|
||||
<string name="err_sync_create_json_request_encoding">Грешка #7: неподржано кодирање при изради захтева</string>
|
||||
<string name="err_sync_auth_failed">Грешка #8: аутентификација није успела</string>
|
||||
<string name="err_sync_http_request_returncode_unhandled">Грешка #9: сервер је поставио необрађен ХТТП повратни код</string>
|
||||
<string name="err_sync_http_request_connect">Грешка #11: не могу да успоставим везу на Оунклауд инстанцу</string>
|
||||
<string name="err_sync_http_request_httpexception">Грешка #12: не могу да успоставим везу на Оунклауд инстанцу</string>
|
||||
<string name="err_sync_http_request_ioexception">Грешка #13: не могу да успоставим везу на Оунклауд инстанцу</string>
|
||||
<string name="err_sync_http_request_resp">Грешка #14: не могу да рашчланим одговор сервера</string>
|
||||
<string name="err_sync_http_request_parse_resp">Грешка #15: не могу да рашчланим одговор сервера</string>
|
||||
<string name="err_sync_no_connection_available">Грешка #16: нема везе на интернет</string>
|
||||
<string name="err_sync_account_unparsable">Грешка #17: деформисан налог. Поставите га поново</string>
|
||||
<string name="title_activity_main">Главна активност</string>
|
||||
<string name="title_section1">Одељак 1</string>
|
||||
<string name="title_section2">Одељак 2</string>
|
||||
<string name="title_section3">Одељак 3</string>
|
||||
<string name="title_activity_main_activity2">Главна активност 2</string>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* Copyright (c) 2015, Daniel Hansson <daniel@en0ch.se>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
<!-- Translation version, reference for translators -->
|
||||
<string name="gp_translation_version">4</string>
|
||||
<!-- Translations must begin here -->
|
||||
<string name="gp_short_description">ownCloud SMS synkroniserar dina lokala SMS till din ownCloudinstans.</string>
|
||||
<string name="gp_description">
|
||||
ownCloud SMS-applikationen synkroniserar dina SMS-meddelanden till din ownCloudinstans och gör det möjligt att läsa dina meddelanden på den.
|
||||
|
||||
Skicka meddelanden från din ownCloudinstans kommer att bli möjligt i en kommande version.
|
||||
|
||||
Applikationen är fullt kompatibel från Android 4.0 till 5.1
|
||||
</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,152 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* Copyright (c) 2015, Daniel Hansson <daniel@en0ch.se>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
<!-- Translation version, reference for translators -->
|
||||
<string name="translation_version">6</string>
|
||||
|
||||
<!-- Translations must begin there -->
|
||||
<!-- Preferences -->
|
||||
<string name="pref_title_sync">SMS - Snabb</string>
|
||||
<string name="pref_title_sync_frequency">Intervall mellan synkorniseringar</string>
|
||||
<string name="pref_title_slow_sync">SMS - Långsam och Säker</string>
|
||||
<string name="pref_title_slow_sync_frequency">Intervall mellan synkorniseringar</string>
|
||||
<string name="action_settings">Inställningar</string>
|
||||
<string name="sync_now">Synkronisera nu</string>
|
||||
<string name="pref_category_sync">Synkronisering</string>
|
||||
<string name="title_global_pref_to_general_prefs">Globala inställningar</string>
|
||||
<string name="summary_global_pref_to_general_prefs">Synkroniseringsalternativ</string>
|
||||
<string name="summary_notif_prefs">Notifikationer</string>
|
||||
<string name="pref_header_data_sync">Data & synk</string>
|
||||
<string name="title_activity_general_settings">Generella inställningar</string>
|
||||
|
||||
<string-array name="pref_sync_frequency_titles">
|
||||
<item>5 minuter</item>
|
||||
<item>15 minuter</item>
|
||||
<item>30 minuter</item>
|
||||
<item>1 timme</item>
|
||||
<item>3 timmar</item>
|
||||
<item>6 timmar</item>
|
||||
<item>12 timmar</item>
|
||||
<item>24 timmar</item>
|
||||
<item>Aldrig</item>
|
||||
</string-array>
|
||||
<string-array name="pref_sync_frequency_values">
|
||||
<item>5</item>
|
||||
<item>15</item>
|
||||
<item>30</item>
|
||||
<item>60</item>
|
||||
<item>180</item>
|
||||
<item>360</item>
|
||||
<item>720</item>
|
||||
<item>1440</item>
|
||||
<item>-1</item>
|
||||
</string-array>
|
||||
<string-array name="pref_slow_sync_frequency_titles">
|
||||
<item>1 timme</item>
|
||||
<item>3 timmar</item>
|
||||
<item>6 timmar</item>
|
||||
<item>12 timmar</item>
|
||||
<item>24 timmar</item>
|
||||
<item>Aldrig</item>
|
||||
</string-array>
|
||||
<string-array name="pref_slow_sync_frequency_values">
|
||||
<item>60</item>
|
||||
<item>180</item>
|
||||
<item>360</item>
|
||||
<item>720</item>
|
||||
<item>1440</item>
|
||||
<item>-1</item>
|
||||
</string-array>
|
||||
|
||||
<string name="title_activity_login">Logga in</string>
|
||||
|
||||
<string name="pref_sync_wifi">Synkronisera med Wi-Fi</string>
|
||||
<string name="pref_sync_4g">Synkronisera med 4G</string>
|
||||
<string name="pref_sync_3g">Synkronisera med 3G</string>
|
||||
<string name="pref_sync_gprs">Synkronisera med 2.5G (GPRS)</string>
|
||||
<string name="pref_sync_2g">Synkronisera med 2G</string>
|
||||
<string name="pref_sync_others">Synkronisera med övriga</string>
|
||||
|
||||
<!-- Login -->
|
||||
<string name="prompt_login">Användarnamn</string>
|
||||
<string name="prompt_password">Lösenord</string>
|
||||
<string name="action_sign_in">Logga in eller registrera</string>
|
||||
<string name="action_sign_in_short">Logga in</string>
|
||||
<string name="error_invalid_login">Användarnamn eller lösenord felaktigt</string>
|
||||
<string name="error_invalid_password">Lösenordet är för kort</string>
|
||||
<string name="error_field_required">Detta fält är obligatoriskt</string>
|
||||
<string name="prompt_serverURI">Serveradress</string>
|
||||
<string name="error_invalid_server_address">Felaktig serveradress</string>
|
||||
<string name="error_connection_failed">Anslutning misslyckades, vänligen säkerställ att detta är rätt server</string>
|
||||
<string name="error_http_connection_failed">Det gick inte att genomföra en HTTP-anslutning. Vänligen säkerställ att det finns en web-server</string>
|
||||
|
||||
<!-- Main activity -->
|
||||
<string name="ma_button_rate_us">Skriv en recension!</string>
|
||||
<string name="ma_button_thanksto">Tack till</string>
|
||||
<string name="ma_title_rate_us">Skriv en recension!</string>
|
||||
<string name="ma_content_rate_us">Om du gillar den här applikationen, ge oss ett omdömme i Google Play butiken</string>
|
||||
<string name="ma_title_add_account">Lägg till ett konto</string>
|
||||
<string name="ma_button_goto_sync">Gå till Konto och Synkronisering</string>
|
||||
<string name="ma_title_change_settings">Ändra applikationsinställningar</string>
|
||||
<string name="ma_button_goto_settings">Gå till Inställningar</string>
|
||||
<string name="ma_title_welcome">Välkommen</string>
|
||||
<string name="ma_content_welcome">Välkommen till ownCloud SMS. Den här applikationen gör det möjligt att synkronisera dina SMS till din ownCloud-server.</string>
|
||||
<string name="ma_thanksto_people">- Utvecklarna utav ownCloud\n\ - De som bidragit, och som anmält buggar</string>
|
||||
<string name="ma_title_sync_all">Synkronisera alla meddelanden</string>
|
||||
<string name="ma_button_sync_accounts_now">Starta synkronisering nu</string>
|
||||
|
||||
<!-- Notifications -->
|
||||
<string name="sync_title">Synkroniseringsprocesss</string>
|
||||
<string name="sync_inprogress">Pågående synkronisering</string>
|
||||
<string name="fatal_error">Allvarligt fel! </string>
|
||||
|
||||
<!-- Errors -->
|
||||
<string name="err_sync_get_smslist">Error #1: Invalid data received from server when getting previous messages</string>
|
||||
<string name="err_sync_craft_http_request">Error #2: Error while crafting HTTP request</string>
|
||||
<string name="err_sync_push_request">Error #3: Push request failed</string>
|
||||
<string name="err_sync_push_request_resp">Error #4: Invalid datas received from server when pushing datas</string>
|
||||
<string name="err_sync_create_json_null_smslist">Error #5: NULL SMS List</string>
|
||||
<string name="err_sync_create_json_put_smslist">Error #6: Error while crafting push request</string>
|
||||
<string name="err_sync_create_json_request_encoding">Error #7: Unsupported encoding when generating request</string>
|
||||
<string name="err_sync_auth_failed">Error #8: Authentication failed</string>
|
||||
<string name="err_sync_http_request_returncode_unhandled">Error #9: Server set unhandled HTTP return code</string>
|
||||
<string name="err_sync_http_request_connect">Error #11: Unable to perform a connection to ownCloud instance</string>
|
||||
<string name="err_sync_http_request_httpexception">Error #12: Unable to perform a connection to ownCloud instance</string>
|
||||
<string name="err_sync_http_request_ioexception">Error #13: Unable to perform a connection to ownCloud instance</string>
|
||||
<string name="err_sync_http_request_resp">Error #14: Unable to parse server response</string>
|
||||
<string name="err_sync_http_request_parse_resp">Error #15: Unable to parse server response</string>
|
||||
<string name="err_sync_no_connection_available">Error #16: No data connection available</string>
|
||||
<string name="err_sync_account_unparsable">Error #17: malformed account. Please reconfigure it</string>
|
||||
<string name="title_activity_main">MainActivity</string>
|
||||
<string name="title_section1">Section 1</string>
|
||||
<string name="title_section2">Section 2</string>
|
||||
<string name="title_section3">Section 3</string>
|
||||
<string name="title_activity_main_activity2">MainActivity2</string>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,39 @@
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<style name="OcSmsTheme" parent="@android:style/Theme.Holo.Light.DarkActionBar">
|
||||
<item name="android:actionBarStyle">@style/OcSmsActionBar</item>
|
||||
</style>
|
||||
|
||||
<style name="OcSmsActionBar"
|
||||
parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
|
||||
<item name="android:background">#56a6cf</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,10 @@
|
||||
<resources>
|
||||
|
||||
<!--
|
||||
Example customization of dimensions originally defined in res/values/dimens.xml
|
||||
(such as screen margins) for screens with more than 820dp of available width. This
|
||||
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
|
||||
-->
|
||||
<dimen name="activity_horizontal_margin">64dp</dimen>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,8 @@
|
||||
<resources>
|
||||
|
||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||
<dimen name="arrow_max_height">22dp</dimen>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
<!-- Translation version, reference for translators -->
|
||||
<string name="gp_translation_version">3</string>
|
||||
|
||||
<!-- Translations must begin here -->
|
||||
<string name="gp_short_description">ownCloud SMS synchronize your local SMS on your ownCloud instance</string>
|
||||
<string name="gp_description">
|
||||
ownCloud SMS application synchronize your SMS messages on a remote ownCloud instance and let you read your messages from it.
|
||||
|
||||
Sending SMS from ownCloud instance will coming in a future release.
|
||||
|
||||
Application is fully compatible from Android 4.0 to 5.0
|
||||
</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,176 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
<resources>
|
||||
|
||||
<!-- Translation version, reference for translators -->
|
||||
<string name="translation_version">7</string>
|
||||
|
||||
<!-- System strings, do not translate -->
|
||||
<string name="app_name">ownCloud-SMS</string>
|
||||
<string name="account_type">fr.unix_experience.owncloud_sms</string>
|
||||
<string name="account_authority">fr.unix_experience.owncloud_sms.datasync.provider</string>
|
||||
<string name="slowsync_account_authority">fr.unix_experience.owncloud_sms.datasync.slowsync_provider</string>
|
||||
<string name="target_package">fr.unix_experience.owncloud_sms</string>
|
||||
<string name="login_logo">Login logo</string>
|
||||
|
||||
<!-- System strings: preferences -->
|
||||
<string name="shared_preference_file">ownCloudSMSPrefs</string>
|
||||
<string name="pref_lastmsgdate">last_message_date</string>
|
||||
|
||||
<!-- Translations must begin there -->
|
||||
<!-- Preferences -->
|
||||
<string name="pref_title_sync">SMS - Fast</string>
|
||||
<string name="pref_title_sync_frequency">Fast Sync frequency</string>
|
||||
<string name="pref_title_slow_sync">SMS - Slow and Secure</string>
|
||||
<string name="pref_title_slow_sync_frequency">Secure Slow Sync frequency</string>
|
||||
<string name="action_settings">Settings</string>
|
||||
<string name="sync_now">Synchronize now</string>
|
||||
<string name="pref_category_sync">Synchronization</string>
|
||||
<string name="title_global_pref_to_general_prefs">General preferences</string>
|
||||
<string name="summary_global_pref_to_general_prefs">Sync options</string>
|
||||
<string name="summary_notif_prefs">Notifications</string>
|
||||
<string name="pref_header_data_sync">Data & sync</string>
|
||||
<string name="title_activity_general_settings">General Settings</string>
|
||||
|
||||
<string-array name="pref_sync_frequency_titles">
|
||||
<item>5 minutes</item>
|
||||
<item>15 minutes</item>
|
||||
<item>30 minutes</item>
|
||||
<item>1 hour</item>
|
||||
<item>3 hours</item>
|
||||
<item>6 hours</item>
|
||||
<item>12 hours</item>
|
||||
<item>24 hours</item>
|
||||
<item>Never</item>
|
||||
</string-array>
|
||||
<string-array name="pref_sync_frequency_values">
|
||||
<item>5</item>
|
||||
<item>15</item>
|
||||
<item>30</item>
|
||||
<item>60</item>
|
||||
<item>180</item>
|
||||
<item>360</item>
|
||||
<item>720</item>
|
||||
<item>1440</item>
|
||||
<item>-1</item>
|
||||
</string-array>
|
||||
<string-array name="pref_slow_sync_frequency_titles">
|
||||
<item>1 hour</item>
|
||||
<item>3 hours</item>
|
||||
<item>6 hours</item>
|
||||
<item>12 hours</item>
|
||||
<item>24 hours</item>
|
||||
<item>Never</item>
|
||||
</string-array>
|
||||
<string-array name="pref_slow_sync_frequency_values">
|
||||
<item>60</item>
|
||||
<item>180</item>
|
||||
<item>360</item>
|
||||
<item>720</item>
|
||||
<item>1440</item>
|
||||
<item>-1</item>
|
||||
</string-array>
|
||||
|
||||
<string name="pref_push_on_receive">Push SMS on reception</string>
|
||||
<string name="pref_sync_wifi">Synchronize in Wi-Fi</string>
|
||||
<string name="pref_sync_4g">Synchronize in 4G</string>
|
||||
<string name="pref_sync_3g">Synchronize in 3G</string>
|
||||
<string name="pref_sync_gprs">Synchronize in 2.5G (GPRS)</string>
|
||||
<string name="pref_sync_2g">Synchronize in 2G</string>
|
||||
<string name="pref_sync_others">Synchronize in other modes</string>
|
||||
<string name="title_activity_login">Sign in</string>
|
||||
|
||||
<!-- Login -->
|
||||
<string name="prompt_login">Login</string>
|
||||
<string name="prompt_password">Password </string>
|
||||
<string name="action_sign_in">Sign in or register</string>
|
||||
<string name="action_sign_in_short">Sign in</string>
|
||||
<string name="error_invalid_login">Login or password incorrect</string>
|
||||
<string name="error_invalid_password">This password is too short</string>
|
||||
<string name="error_field_required">This field is required</string>
|
||||
<string name="prompt_serverURI">Server address</string>
|
||||
<string name="error_invalid_server_address">Invalid server address</string>
|
||||
<string name="error_connection_failed">Connection failed, ensure this is the right server</string>
|
||||
<string name="error_http_connection_failed">Unable to perform a HTTP connection. Please ensure there is a web server</string>
|
||||
|
||||
<string-array name="protocol_array">
|
||||
<item>https://</item>
|
||||
<item>http://</item>
|
||||
</string-array>
|
||||
|
||||
<!-- Main activity -->
|
||||
<string name="ma_button_rate_us">Rate us !</string>
|
||||
<string name="ma_button_thanksto">Thanks to</string>
|
||||
<string name="ma_title_rate_us">Rate us !</string>
|
||||
<string name="ma_content_rate_us">If you like this application, please give rate us on Google Play Store</string>
|
||||
<string name="ma_title_add_account">Add an account</string>
|
||||
<string name="ma_button_goto_sync">Go to Accounts and Sync</string>
|
||||
<string name="ma_title_change_settings">Change app settings</string>
|
||||
<string name="ma_button_goto_settings">Go to Settings</string>
|
||||
<string name="ma_title_welcome">Welcome</string>
|
||||
<string name="ma_content_welcome">Welcome to ownCloud SMS application. This application let you synchronize your SMS to your ownCloud instance using SMS app.</string>
|
||||
<string name="ma_thanksto_people">ownCloud developers\n\
|
||||
Contributors and issue\'s reporters</string>
|
||||
<string name="ma_title_sync_all">Synchronize all messages</string>
|
||||
<string name="ma_button_sync_accounts_now">Launch synchronization now</string>
|
||||
<string name="ma_title_remote_account">Remote account</string>
|
||||
<string name="choose_account">Choose account</string>
|
||||
|
||||
<!-- Restauration -->
|
||||
<string name="title_activity_select_account">Select account</string>
|
||||
<string name="title_activity_select_contact">Select contact</string>
|
||||
|
||||
<!-- Notifications -->
|
||||
<string name="sync_title">Sync process</string>
|
||||
<string name="sync_inprogress">Sync in progress...</string>
|
||||
<string name="fatal_error">Fatal error ! </string>
|
||||
|
||||
<!-- Errors -->
|
||||
<string name="err_sync_get_smslist">Error #1: Invalid data received from server when getting previous messages</string>
|
||||
<string name="err_sync_craft_http_request">Error #2: Error while crafting HTTP request</string>
|
||||
<string name="err_sync_push_request">Error #3: Push request failed</string>
|
||||
<string name="err_sync_push_request_resp">Error #4: Invalid datas received from server when pushing datas</string>
|
||||
<string name="err_sync_create_json_null_smslist">Error #5: NULL SMS List</string>
|
||||
<string name="err_sync_create_json_put_smslist">Error #6: Error while crafting push request</string>
|
||||
<string name="err_sync_create_json_request_encoding">Error #7: Unsupported encoding when generating request</string>
|
||||
<string name="err_sync_auth_failed">Error #8: Authentication failed</string>
|
||||
<string name="err_sync_http_request_returncode_unhandled">Error #9: Server set unhandled HTTP return code</string>
|
||||
<string name="err_sync_http_request_connect">Error #11: Unable to perform a connection to ownCloud instance</string>
|
||||
<string name="err_sync_http_request_httpexception">Error #12: Unable to perform a connection to ownCloud instance</string>
|
||||
<string name="err_sync_http_request_ioexception">Error #13: Unable to perform a connection to ownCloud instance</string>
|
||||
<string name="err_sync_http_request_resp">Error #14: Unable to parse server response</string>
|
||||
<string name="err_sync_http_request_parse_resp">Error #15: Unable to parse server response</string>
|
||||
<string name="err_sync_no_connection_available">Error #16: No data connection available</string>
|
||||
<string name="err_sync_account_unparsable">Error #17: malformed account. Please reconfigure it</string>
|
||||
<string name="err_sync_ocsms_not_installed_or_oc_upgrade_required">Error #18: OcSMS app is not installed or ownCloud awaiting for an upgrade</string>
|
||||
|
||||
<string name="title_activity_main">MainActivity</string>
|
||||
<string name="title_section1">Section 1</string>
|
||||
<string name="title_section2">Section 2</string>
|
||||
<string name="title_section3">Section 3</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,40 @@
|
||||
<!--
|
||||
/*
|
||||
* Copyright (c) 2014-2015, Loic Blot <loic.blot@unix-experience.fr>
|
||||
* All rights reserved.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<style name="AppBaseTheme" parent="@android:style/Theme.Holo.Light">
|
||||
</style>
|
||||
|
||||
<!-- Application theme. -->
|
||||
<style name="AppTheme" parent="AppBaseTheme">
|
||||
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
|
||||
</style>
|
||||
<style name="StandardButton">
|
||||
<item name="android:textColor">#ffffff</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,16 @@
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:key="global_settings"
|
||||
android:title="Global Preferences"
|
||||
android:summary="Global preferences">
|
||||
|
||||
<Preference
|
||||
android:key="general_prefs"
|
||||
android:summary="@string/summary_global_pref_to_general_prefs"
|
||||
android:title="@string/title_global_pref_to_general_prefs" >
|
||||
<intent android:targetPackage="fr.unix_experience.owncloud_sms"
|
||||
android:targetClass="fr.unix_experience.owncloud_sms.activities.GeneralSettingsActivity"
|
||||
android:action="ACTION_VIEW" />
|
||||
</Preference>
|
||||
|
||||
</PreferenceScreen>
|
||||
@@ -0,0 +1,6 @@
|
||||
<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:accountType="@string/account_type"
|
||||
android:label="@string/app_name"
|
||||
android:icon="@drawable/ic_launcher"
|
||||
android:smallIcon="@drawable/ic_launcher"
|
||||
android:accountPreferences="@xml/global_preferences"/>
|
||||
@@ -0,0 +1,56 @@
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<PreferenceCategory
|
||||
android:title="@string/summary_global_pref_to_general_prefs">
|
||||
<ListPreference
|
||||
android:defaultValue="15"
|
||||
android:entries="@array/pref_sync_frequency_titles"
|
||||
android:entryValues="@array/pref_sync_frequency_values"
|
||||
android:key="sync_frequency"
|
||||
android:negativeButtonText="@null"
|
||||
android:positiveButtonText="@null"
|
||||
android:title="@string/pref_title_sync_frequency" />
|
||||
<CheckBoxPreference android:id="@+id/checkbox_push_on_receive"
|
||||
android:defaultValue="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:key="push_on_receive"
|
||||
android:title="@string/pref_push_on_receive" />
|
||||
<CheckBoxPreference android:id="@+id/checkbox_sync_wifi"
|
||||
android:defaultValue="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:key="sync_wifi"
|
||||
android:title="@string/pref_sync_wifi" />
|
||||
<CheckBoxPreference android:id="@+id/checkbox_sync_4g"
|
||||
android:defaultValue="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:key="sync_4g"
|
||||
android:title="@string/pref_sync_4g" />
|
||||
<CheckBoxPreference android:id="@+id/checkbox_sync_3g"
|
||||
android:defaultValue="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:key="sync_3g"
|
||||
android:title="@string/pref_sync_3g" />
|
||||
<CheckBoxPreference android:id="@+id/checkbox_sync_2g"
|
||||
android:defaultValue="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:key="sync_2g"
|
||||
android:title="@string/pref_sync_2g" />
|
||||
<CheckBoxPreference android:id="@+id/checkbox_sync_gprs"
|
||||
android:defaultValue="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:key="sync_gprs"
|
||||
android:title="@string/pref_sync_gprs" />
|
||||
<CheckBoxPreference android:id="@+id/checkbox_sync_others"
|
||||
android:defaultValue="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:key="sync_others"
|
||||
android:title="@string/pref_sync_others" />
|
||||
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<sync-adapter
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:contentAuthority="@string/slowsync_account_authority"
|
||||
android:accountType="@string/account_type"
|
||||
android:userVisible="true"
|
||||
android:supportsUploading="true"
|
||||
android:allowParallelSyncs="false"
|
||||
android:isAlwaysSyncable="true" />
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<sync-adapter
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:contentAuthority="@string/account_authority"
|
||||
android:accountType="@string/account_type"
|
||||
android:userVisible="true"
|
||||
android:supportsUploading="true"
|
||||
android:allowParallelSyncs="false"
|
||||
android:isAlwaysSyncable="true" />
|
||||