Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
Visit http://ub0r.de/translate/websms-api/de/strings.xml to edit the file.
-->
<resources>
<string name="info_text" formatted="false" orig="This is a WebSMS Connector.\nThe only way to use it, is lauching it with WebSMS.">Diese App ist ein WebSMS Connector.\nDu kannst ihn nur mit WebSMS nutzen.</string>
<string name="stat_notify_sms_pending" formatted="false" orig="WebSMS: sending">WebSMS: senden</string>
<string name="info_text" formatted="false" orig="This is a Websms Connector.\nThe only way to use it, is lauching it with WebSMS or mysms.">Diese App ist ein Websms Connector.\nDu kannst ihn nur mit WebSMS oder mysms nutzen.</string>
<string name="stat_notify_sms_pending" formatted="false" orig="Websms: sending">Websms: senden</string>
<string name="stat_notify_sending" formatted="false">Sende:</string>
<string name="error" formatted="false">FEHLER</string>
<string name="error_connection" formatted="false" username="Schiri &lt;schirinowski@gmail.com&gt;" orig="Connection terminated/timed out. If your connection is working, it\'s most likely a downtime of the target service. Check the app\'s website issues and twitter for status.">Verbindung abgebrochen/fehlgeschlagen. Wenn deine Verbindung funktioniert, ist das sehr wahrscheinlich eine Downtime des Services. Kontrolliere die Issues auf der App-Website sowie Twitter für weitere Informationen.</string>
Expand Down
4 changes: 2 additions & 2 deletions res/values-hu/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
Visit http://ub0r.de/translate/websms-api/hu/strings.xml to edit the file.
-->
<resources>
<string name="info_text" formatted="false">Ez egy WebSMS kiegészítő.\nKizárólag a WebSMS-el együtt haszálható!</string>
<string name="stat_notify_sms_pending" formatted="false">WebSMS: küldés</string>
<string name="info_text" formatted="false">Ez egy Websms kiegészítő.\nKizárólag a WebSMS-el együtt haszálható!</string>
<string name="stat_notify_sms_pending" formatted="false">Websms: küldés</string>
<string name="stat_notify_sending" formatted="false">Küldés:</string>
<string name="error" formatted="false">HIBA</string>
<string name="error_connection" formatted="false" username="Tamás Béres &lt;berestamas2@gmail.com&gt;" orig="Connection terminated/timed out. If your connection is working, it\'s most likely a downtime of the target service. Check the app\'s website issues and twitter for status.">Kapcsolat időtúllépési hiba. Ha az internetkapcsolatod működik, akkor valószínűleg a cél szerverrel van a hiba. A program honlapján és twitter accountján általában be van jelentve ha valami gond van.</string>
Expand Down
4 changes: 2 additions & 2 deletions res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
Visit http://ub0r.de/translate/websms-api/it/strings.xml to edit the file.
-->
<resources>
<string name="info_text" formatted="false" username="carloraudino@fedoraproject.org" orig="This is a WebSMS Connector.\nThe only way to use it, is lauching it with WebSMS.">Questo è un Connector per WebSMS&#13;
<string name="info_text" formatted="false" username="carloraudino@fedoraproject.org" orig="This is a Websms Connector.\nThe only way to use it, is lauching it with WebSMS or mysms.">Questo è un Connector per Websms&#13;
L\'unico modo per usarlo è lanciarlo con WebSMS.</string>
<string name="stat_notify_sms_pending" formatted="false" username="carloraudino@fedoraproject.org" orig="WebSMS: sending">WebSMS: invio</string>
<string name="stat_notify_sms_pending" formatted="false" username="carloraudino@fedoraproject.org" orig="Websms: sending">Websms: invio</string>
<string name="stat_notify_sending" formatted="false" username="carloraudino@fedoraproject.org" orig="Sending:">Invio:</string>
<string name="error" formatted="false" username="carloraudino@fedoraproject.org" orig="ERROR">ERRORE</string>
<string name="error_connection" formatted="false" username="carloraudino@fedoraproject.org" orig="Connection terminated/timed out. If your connection is working, it\'s most likely a downtime of the target service. Check the app\'s website issues and twitter for status.">Connessione terminata/scaduta. Se la connessione funziona, probabilmente si tratta di un guasto del servizio. Vedere il sito dell\'app per problemi e twitter per lo stato.</string>
Expand Down
4 changes: 2 additions & 2 deletions res/values-ro/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
Visit http://ub0r.de/translate/websms-api/ro/strings.xml to edit the file.
-->
<resources>
<string name="info_text" formatted="false" username="Laurentiu Lozan &lt;lozanro@gmail.com&gt;" orig="This is a WebSMS Connector.\nThe only way to use it, is lauching it with WebSMS.">Acesta este un Conector WebSMS.\nUnica modalitate de a-l folosi este cu ajutorul aplicației WebSMS.</string>
<string name="stat_notify_sms_pending" formatted="false" username="Laurentiu Lozan &lt;lozanro@gmail.com&gt;" orig="WebSMS: sending">WebSMS: trimitere</string>
<string name="info_text" formatted="false" username="Laurentiu Lozan &lt;lozanro@gmail.com&gt;" orig="This is a Websms Connector.\nThe only way to use it, is lauching it with WebSMS or mysms.">Acesta este un Conector Websms.\nUnica modalitate de a-l folosi este cu ajutorul aplicației WebSMS.</string>
<string name="stat_notify_sms_pending" formatted="false" username="Laurentiu Lozan &lt;lozanro@gmail.com&gt;" orig="Websms: sending">Websms: trimitere</string>
<string name="stat_notify_sending" formatted="false" username="Laurentiu Lozan &lt;lozanro@gmail.com&gt;" orig="Sending:">Trimitere:</string>
<string name="error" formatted="false" username="Laurentiu Lozan &lt;lozanro@gmail.com&gt;" orig="ERROR">EROARE</string>
<string name="error_connection" formatted="false" username="Laurentiu Lozan &lt;lozanro@gmail.com&gt;" orig="Connection terminated/timed out. If your connection is working, it\'s most likely a downtime of the target service. Check the app\'s website issues and twitter for status.">Conexiune terminată/întârziată. Dacă aveți o conexiune care lucrează, cel mai probabil e o problemă a serviciului țintă. Verificați situl web al aplicației sau canalul Twitter pentru statut.</string>
Expand Down
4 changes: 2 additions & 2 deletions res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
Visit http://ub0r.de/translate/websms-api/ru/strings.xml to edit the file.
-->
<resources>
<string name="info_text" formatted="false">This is a WebSMS Connector.\nThe only way to use it, is lauching it with WebSMS.</string>
<string name="stat_notify_sms_pending" formatted="false" orig="WebSMS: sending">WebSMS: Отправка</string>
<string name="info_text" formatted="false">This is a Websms Connector.\nThe only way to use it, is lauching it with WebSMS or mysms.</string>
<string name="stat_notify_sms_pending" formatted="false" orig="Websms: sending">Websms: Отправка</string>
<string name="stat_notify_sending" formatted="false">Отправка:</string>
<string name="error" formatted="false">ОШИБКА</string>
<string name="error_http" formatted="false">ОШИБКА: HTTP</string>
Expand Down
4 changes: 2 additions & 2 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
-->
<resources>
<!-- Common strings. -->
<string name="info_text">This is a WebSMS Connector.\nThe only way to use it, is lauching it with WebSMS.</string>
<string name="stat_notify_sms_pending">WebSMS: sending</string>
<string name="info_text">This is a Websms Connector.\nThe only way to use it, is lauching it with WebSMS or mysms.</string>
<string name="stat_notify_sms_pending">Websms: sending</string>
<string name="stat_notify_sending">Sending:</string>
<string name="error">ERROR</string>
<string name="error_connection">Connection terminated/timed out. If your connection is working, it\'s most likely a downtime of the target service. Check the app\'s website issues and twitter for status.</string>
Expand Down
116 changes: 70 additions & 46 deletions src/de/ub0r/android/websms/connector/common/InfoActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,29 @@ public final class InfoActivity extends Activity {
/** Tag for debug output. */
private static final String TAG = "Info";

/** Link to WebSMS in android market. */
private static final Intent INTENT_MARKET_WEBSMS = new Intent(
Intent.ACTION_VIEW, Uri.parse(// .
"market://search?q=pname:de.ub0r.android.websms"));
/** WebSMS package name */
private static final String PACKAGENAME_WEBSMS = "de.ub0r.android.websms";

/** Link to Connectors in android market. */
private static final Intent INTENT_MARKET_CONNECTORS = new Intent(
Intent.ACTION_VIEW, Uri.parse(// .
"market://search?q=websms+connector"));
/** mysms package name */
private static final String PACKAGENAME_MYSMS = "com.mysms.android.sms";

/** Info text shown to user. */
private static final String INFO_TEXT = "This is a WebSMS Connector."
+ "\nThe only way to use it, is lauching it with WebSMS.";
+ "\nThe only way to use it, is lauching it with WebSMS or mysms.";

/** Button label: websms. */
private static final String BTN_WEBSMS = "WebSMS";

/** Button label: mysms. */
private static final String BTN_MYSMS = "mysms";

/** Button label: search websms. */
private static final String BTN_MARKET_WEBSMS = "market: WebSMS";
/** Button label: search connectors. */
private static final String BTN_MARKET_CONNECTORS = // .
"market: Connectors";
/** Link to WebSMS in android market. */
private Intent intentWebsms = new Intent(Intent.ACTION_VIEW, Uri.parse(// .
"market://search?q=pname:" + PACKAGENAME_WEBSMS));

/** Link to mysms in android market. */
private Intent intentMysms = new Intent(Intent.ACTION_VIEW, Uri.parse(// .
"market://search?q=pname:" + PACKAGENAME_MYSMS));

/**
* {@inheritDoc}
Expand All @@ -76,8 +80,11 @@ protected void onResume() {
final String pkg = this.getPackageName();
final int info = this.getResources().getIdentifier("info_text",
"string", pkg);
final int icon = this.getResources().getIdentifier("icon", "drawable",
int icon = this.getResources().getIdentifier("app_icon", "drawable",
pkg);
if (icon == 0) {
icon = this.getResources().getIdentifier("icon", "drawable", pkg);
}
Log.d(TAG, "resID.icon=" + icon);
Log.d(TAG, "resID.info=" + info);
if (icon > 0) {
Expand All @@ -96,38 +103,55 @@ public void onClick(final DialogInterface dialog,
InfoActivity.this.finish();
}
});
final List<ResolveInfo> ri = this.getPackageManager()
.queryBroadcastReceivers(new Intent(Connector.ACTION_INFO), 0);
if (ri.size() == 0) {
b.setNeutralButton(BTN_MARKET_WEBSMS,
new DialogInterface.OnClickListener() {
@Override
public void onClick(final DialogInterface dialog,
final int which) {
try {
InfoActivity.this
.startActivity(INTENT_MARKET_WEBSMS);
} catch (ActivityNotFoundException e) {
Log.e(TAG, "no market", e);
}
InfoActivity.this.finish();
}
});

Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
List<ResolveInfo> ris = this.getPackageManager().queryIntentActivities(
intent, 0);
for (ResolveInfo ri : ris) {
if (ri.activityInfo == null) {
continue;
}
if (ri.activityInfo.packageName.equals(PACKAGENAME_WEBSMS)) {
this.intentWebsms = new Intent(Intent.ACTION_MAIN);
this.intentWebsms.addCategory(Intent.CATEGORY_LAUNCHER);
this.intentWebsms.setClassName(ri.activityInfo.packageName,
ri.activityInfo.name);
} else if (ri.activityInfo.packageName.equals(PACKAGENAME_MYSMS)) {
this.intentMysms = new Intent(Intent.ACTION_MAIN);
this.intentMysms.addCategory(Intent.CATEGORY_LAUNCHER);
this.intentMysms.setClassName(ri.activityInfo.packageName,
ri.activityInfo.name);
}
}
b.setNegativeButton(BTN_MARKET_CONNECTORS,
new DialogInterface.OnClickListener() {
@Override
public void onClick(final DialogInterface dialog,
final int which) {
try {
InfoActivity.this
.startActivity(INTENT_MARKET_CONNECTORS);
} catch (ActivityNotFoundException e) {
Log.e(TAG, "no market", e);
}
InfoActivity.this.finish();
}
});
b.setPositiveButton(BTN_WEBSMS, new DialogInterface.OnClickListener() {
@Override
public void onClick(final DialogInterface dialog, final int which) {
try {
InfoActivity.this.intentWebsms
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
InfoActivity.this
.startActivity(InfoActivity.this.intentWebsms);
} catch (ActivityNotFoundException e) {
Log.e(TAG, "no market", e);
}
InfoActivity.this.finish();
}
});
b.setNeutralButton(BTN_MYSMS, new DialogInterface.OnClickListener() {
@Override
public void onClick(final DialogInterface dialog, final int which) {
try {
InfoActivity.this.intentMysms
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
InfoActivity.this
.startActivity(InfoActivity.this.intentMysms);
} catch (ActivityNotFoundException e) {
Log.e(TAG, "no market", e);
}
InfoActivity.this.finish();
}
});
b.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(final DialogInterface dialog) {
Expand Down