mirror of
https://github.com/cwinfo/envayasms.git
synced 2024-12-04 12:35:32 +00:00
organize code into subpackages
This commit is contained in:
parent
e78598c919
commit
46710c24a7
@ -16,53 +16,52 @@
|
||||
|
||||
<application android:name="org.envaya.kalsms.App"
|
||||
android:icon="@drawable/icon" android:label="@string/app_name">
|
||||
<activity android:name=".Main" android:label="@string/app_name">
|
||||
<activity android:name=".ui.Main" 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=".Help" android:label="@string/app_name">
|
||||
<activity android:name=".ui.Help" android:label="@string/app_name">
|
||||
</activity>
|
||||
|
||||
<activity android:name=".ForwardInbox" android:label="@string/app_name">
|
||||
<activity android:name=".ui.ForwardInbox" android:label="@string/app_name">
|
||||
</activity>
|
||||
|
||||
|
||||
<receiver android:name=".SMSReceiver">
|
||||
|
||||
<activity android:name=".ui.Prefs"
|
||||
android:label="@string/app_name">
|
||||
</activity>
|
||||
|
||||
<receiver android:name=".receiver.SMSReceiver">
|
||||
<intent-filter android:priority="101">
|
||||
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".MMSReceiver">
|
||||
<receiver android:name=".receiver.MMSReceiver">
|
||||
<intent-filter android:priority="101">
|
||||
<action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED" />
|
||||
<data android:mimeType="application/vnd.wap.mms-message" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".MessageStatusNotifier">
|
||||
<receiver android:name=".receiver.MessageStatusNotifier">
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".OutgoingMessagePoller">
|
||||
<receiver android:name=".receiver.OutgoingMessagePoller">
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".OutgoingMessageRetry">
|
||||
<receiver android:name=".receiver.OutgoingMessageRetry">
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".IncomingMessageRetry">
|
||||
<receiver android:name=".receiver.IncomingMessageRetry">
|
||||
</receiver>
|
||||
|
||||
<receiver android:name=".BootReceiver">
|
||||
<receiver android:name=".receiver.BootReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<activity android:name=".Prefs"
|
||||
android:label="@string/app_name">
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.envaya.kalsms.CheckableRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<org.envaya.kalsms.ui.CheckableRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#cccccc">
|
||||
<org.envaya.kalsms.InertCheckBox android:id="@+id/inbox_checkbox"
|
||||
<org.envaya.kalsms.ui.InertCheckBox android:id="@+id/inbox_checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="false"
|
||||
@ -31,4 +31,4 @@
|
||||
android:focusable="false"
|
||||
android:paddingBottom="6sp"
|
||||
android:textSize="14sp"></TextView>
|
||||
</org.envaya.kalsms.CheckableRelativeLayout>
|
||||
</org.envaya.kalsms.ui.CheckableRelativeLayout>
|
@ -1,5 +1,8 @@
|
||||
package org.envaya.kalsms;
|
||||
|
||||
import org.envaya.kalsms.task.PollerTask;
|
||||
import org.envaya.kalsms.task.HttpTask;
|
||||
import org.envaya.kalsms.receiver.OutgoingMessagePoller;
|
||||
import android.app.Activity;
|
||||
import android.app.AlarmManager;
|
||||
import android.app.Application;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package org.envaya.kalsms;
|
||||
|
||||
import org.envaya.kalsms.task.ForwarderTask;
|
||||
import org.envaya.kalsms.receiver.IncomingMessageRetry;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.telephony.SmsMessage;
|
||||
|
@ -1,22 +0,0 @@
|
||||
package org.envaya.kalsms;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
public class MMSReceiver extends BroadcastReceiver {
|
||||
|
||||
private App app;
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
app = (App) context.getApplicationContext();
|
||||
|
||||
if (!app.isEnabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
app.log("WAP Push received");
|
||||
}
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
|
||||
package org.envaya.kalsms;
|
||||
|
||||
import org.envaya.kalsms.receiver.OutgoingMessageRetry;
|
||||
import org.envaya.kalsms.receiver.MessageStatusNotifier;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
|
@ -1,9 +1,11 @@
|
||||
|
||||
package org.envaya.kalsms;
|
||||
package org.envaya.kalsms.receiver;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import org.envaya.kalsms.App;
|
||||
import org.envaya.kalsms.ui.Main;
|
||||
|
||||
public class BootReceiver extends BroadcastReceiver {
|
||||
|
@ -1,9 +1,10 @@
|
||||
|
||||
package org.envaya.kalsms;
|
||||
package org.envaya.kalsms.receiver;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import org.envaya.kalsms.App;
|
||||
|
||||
public class IncomingMessageRetry extends BroadcastReceiver
|
||||
{
|
27
src/org/envaya/kalsms/receiver/MMSReceiver.java
Executable file
27
src/org/envaya/kalsms/receiver/MMSReceiver.java
Executable file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Based on http://code.google.com/p/android-notifier/, copyright 2011 Rodrigo Damazio
|
||||
* Licensed under the Apache License, Version 2.0
|
||||
*/
|
||||
|
||||
package org.envaya.kalsms.receiver;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import org.envaya.kalsms.App;
|
||||
|
||||
public class MMSReceiver extends BroadcastReceiver {
|
||||
|
||||
private App app;
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
app = (App) context.getApplicationContext();
|
||||
|
||||
if (!app.isEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
app.log("WAP Push received");
|
||||
}
|
||||
}
|
@ -2,12 +2,12 @@
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package org.envaya.kalsms;
|
||||
package org.envaya.kalsms.receiver;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.telephony.SmsManager;
|
||||
import org.envaya.kalsms.App;
|
||||
|
||||
public class MessageStatusNotifier extends BroadcastReceiver {
|
||||
|
@ -1,8 +1,9 @@
|
||||
package org.envaya.kalsms;
|
||||
package org.envaya.kalsms.receiver;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import org.envaya.kalsms.App;
|
||||
|
||||
public class OutgoingMessagePoller extends BroadcastReceiver {
|
||||
|
@ -1,9 +1,10 @@
|
||||
|
||||
package org.envaya.kalsms;
|
||||
package org.envaya.kalsms.receiver;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import org.envaya.kalsms.App;
|
||||
|
||||
public class OutgoingMessageRetry extends BroadcastReceiver
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
package org.envaya.kalsms;
|
||||
package org.envaya.kalsms.receiver;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
@ -7,6 +7,8 @@ import android.os.Bundle;
|
||||
import android.telephony.SmsMessage;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.envaya.kalsms.App;
|
||||
import org.envaya.kalsms.IncomingMessage;
|
||||
|
||||
|
||||
public class SMSReceiver extends BroadcastReceiver {
|
@ -1,7 +1,10 @@
|
||||
package org.envaya.kalsms;
|
||||
package org.envaya.kalsms.task;
|
||||
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.envaya.kalsms.App;
|
||||
import org.envaya.kalsms.IncomingMessage;
|
||||
import org.envaya.kalsms.OutgoingMessage;
|
||||
|
||||
public class ForwarderTask extends HttpTask {
|
||||
|
@ -2,7 +2,7 @@
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package org.envaya.kalsms;
|
||||
package org.envaya.kalsms.task;
|
||||
|
||||
import android.os.AsyncTask;
|
||||
import java.io.IOException;
|
||||
@ -27,6 +27,9 @@ import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.http.params.BasicHttpParams;
|
||||
import org.apache.http.params.HttpConnectionParams;
|
||||
import org.apache.http.params.HttpParams;
|
||||
import org.envaya.kalsms.App;
|
||||
import org.envaya.kalsms.Base64Coder;
|
||||
import org.envaya.kalsms.OutgoingMessage;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
@ -1,8 +1,11 @@
|
||||
|
||||
package org.envaya.kalsms;
|
||||
package org.envaya.kalsms.task;
|
||||
|
||||
import org.envaya.kalsms.task.HttpTask;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.envaya.kalsms.App;
|
||||
import org.envaya.kalsms.OutgoingMessage;
|
||||
|
||||
public class PollerTask extends HttpTask {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package org.envaya.kalsms;
|
||||
package org.envaya.kalsms.ui;
|
||||
|
||||
// from http://www.marvinlabs.com/2010/10/custom-listview-ability-check-items/
|
||||
// package fr.marvinlabs.widget;
|
@ -1,5 +1,5 @@
|
||||
|
||||
package org.envaya.kalsms;
|
||||
package org.envaya.kalsms.ui;
|
||||
|
||||
import android.app.ListActivity;
|
||||
import android.database.Cursor;
|
||||
@ -9,6 +9,9 @@ import android.util.SparseBooleanArray;
|
||||
import android.view.View;
|
||||
import android.widget.ListView;
|
||||
import android.widget.SimpleCursorAdapter;
|
||||
import org.envaya.kalsms.App;
|
||||
import org.envaya.kalsms.IncomingMessage;
|
||||
import org.envaya.kalsms.R;
|
||||
|
||||
|
||||
public class ForwardInbox extends ListActivity {
|
@ -2,14 +2,14 @@
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package org.envaya.kalsms;
|
||||
package org.envaya.kalsms.ui;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.view.Menu;
|
||||
import android.widget.TextView;
|
||||
import org.envaya.kalsms.R;
|
||||
|
||||
/**
|
||||
*
|
@ -1,4 +1,4 @@
|
||||
package org.envaya.kalsms;
|
||||
package org.envaya.kalsms.ui;
|
||||
|
||||
// from http://www.marvinlabs.com/2010/10/custom-listview-ability-check-items/
|
||||
// package fr.marvinlabs.widget;
|
@ -1,5 +1,6 @@
|
||||
package org.envaya.kalsms;
|
||||
package org.envaya.kalsms.ui;
|
||||
|
||||
import org.envaya.kalsms.task.HttpTask;
|
||||
import android.app.Activity;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
@ -17,6 +18,8 @@ import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.envaya.kalsms.App;
|
||||
import org.envaya.kalsms.R;
|
||||
|
||||
public class Main extends Activity {
|
||||
|
@ -1,6 +1,5 @@
|
||||
package org.envaya.kalsms;
|
||||
package org.envaya.kalsms.ui;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
||||
import android.os.Bundle;
|
||||
@ -10,6 +9,8 @@ import android.preference.Preference;
|
||||
import android.preference.PreferenceActivity;
|
||||
import android.preference.PreferenceScreen;
|
||||
import android.view.Menu;
|
||||
import org.envaya.kalsms.App;
|
||||
import org.envaya.kalsms.R;
|
||||
|
||||
public class Prefs extends PreferenceActivity implements OnSharedPreferenceChangeListener {
|
||||
|
Loading…
Reference in New Issue
Block a user