Ray Zhang 12 ani în urmă
părinte
comite
e0749c8494

+ 210 - 123
Apex/src/com/usai/apex/Alarmreceiver.java

@@ -1,24 +1,29 @@
 package com.usai.apex;
 
-import java.util.Set;
-
 import org.json.JSONException;
 import org.json.JSONObject;
 
+import com.usai.util.Crypto;
 import com.usai.util.Network;
+import com.usai.util.dbUtil;
 
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
+import android.content.SharedPreferences;
+import android.database.sqlite.SQLiteDatabase;
 import android.os.AsyncTask;
-import android.os.Bundle;
+import android.os.SystemClock;
 import android.util.Log;
 
 public class Alarmreceiver extends BroadcastReceiver
 {
-	private SearchTask	m_task			= null;
-	
-	public void checkpush()
+	private SearchTask	m_task	= null;
+
+	public void checkpush(Context context)
 	{
 
 		if (m_task != null)
@@ -27,19 +32,26 @@ public class Alarmreceiver extends BroadcastReceiver
 		}
 		// mStatusMessageView.setText(R.string.str_Loading);
 		// showProgress(true);
-		m_task = new SearchTask();
+		m_task = new SearchTask(context);
 
-//		TextView text_page = (TextView) view_page_footer
-//				.findViewById(R.id.text_page);
-//		text_page.setText("Loading...");
-//		text_page.setEnabled(false);
+		// TextView text_page = (TextView) view_page_footer
+		// .findViewById(R.id.text_page);
+		// text_page.setText("Loading...");
+		// text_page.setEnabled(false);
 		m_task.execute();
 
 	}
+
 	class SearchTask extends AsyncTask<Void, Void, Boolean>
 	{
 		int		errorcode;
-		boolean	bfinish	= false;
+		String	content	= null;
+		Context	mcontext;
+
+		public SearchTask(Context context)
+		{
+			mcontext = context;
+		}
 
 		@Override
 		protected Boolean doInBackground(Void... params)
@@ -53,10 +65,10 @@ public class Alarmreceiver extends BroadcastReceiver
 			}
 			String jstr = "";
 			jstr = Network.check_push();
-//			if (module_name.equals("Announcements"))
-//				jstr = Network.get_announcements(lastid, limit);
-//			else
-//				jstr = Network.get_marketnews(lastid, limit);
+			// if (module_name.equals("Announcements"))
+			// jstr = Network.get_announcements(lastid, limit);
+			// else
+			// jstr = Network.get_marketnews(lastid, limit);
 			if (jstr == null || jstr.length() <= 0)
 			{
 				// Log.d(TAG, "json is wrong");
@@ -65,36 +77,8 @@ public class Alarmreceiver extends BroadcastReceiver
 				return false;
 			}
 
-			JSONObject jsobj;
-			//
-			// array = new JSONArray(json);
-			try
-			{
-				jsobj = new JSONObject(jstr);
-				// if (searchresult.get_fieldscount() == 0)
-				// {
-				// JSONObject objfields = jsobj.getJSONObject("fields");
-				// if (objfields != null)
-				// searchresult.init_fields(objfields.toString());
-				// }
-//				int count = jsobj.getInt("total");
-//				if (count < limit)
-//					bfinish = true;
-//				JSONObject objrecords = jsobj.getJSONObject("records");
-//				if (objrecords != null)
-//					searchresult.add_records(objrecords.toString(), count);
-//				errorcode = Network.RESULT_TRUE;
-
-				return true;
-
-			}
-			catch (JSONException e)
-			{
-				// TODO Auto-generated catch block
-				e.printStackTrace();
-			}
-			errorcode = Network.RESULT_NET_ERROR;
-			return false;
+			content = jstr;
+			return true;
 		}
 
 		@Override
@@ -104,68 +88,148 @@ public class Alarmreceiver extends BroadcastReceiver
 			m_task = null;
 			// showProgress(false);
 
-			switch (errorcode)
-			{
-//				case Network.RESULT_NET_NOTAVAILABLE:
-//				{
-//					Toast toast = Toast.makeText(
-//							ApexTrackingApplication.get_instance(),
-//							getText(R.string.msg_connection_none),
-//							Toast.LENGTH_LONG);
-//					toast.setGravity(Gravity.CENTER, 0, 0);
-//					toast.show();
-//					break;
-//				}
-//				case Network.RESULT_NET_ERROR:
-//				{
-//					Toast toast = Toast.makeText(
-//							ApexTrackingApplication.get_instance(),
-//							getText(R.string.msg_net_error), Toast.LENGTH_LONG);
-//					toast.setGravity(Gravity.CENTER, 0, 0);
-//					toast.show();
-//					break;
-//				}
-//				case Network.RESULT_ERROR:
-//				// case Network.RESULT_RESPONSE_NULL:
-//				{
-//					Toast toast = Toast.makeText(
-//							ApexTrackingApplication.get_instance(),
-//							getText(R.string.msg_net_resulterror),
-//							Toast.LENGTH_LONG);
-//					toast.setGravity(Gravity.CENTER, 0, 0);
-//					toast.show();
-//					break;
-//				}
-
-				default:
-					break;
-			}
+			// switch (errorcode)
+			// {
+			// // case Network.RESULT_NET_NOTAVAILABLE:
+			// // {
+			// // Toast toast = Toast.makeText(
+			// // ApexTrackingApplication.get_instance(),
+			// // getText(R.string.msg_connection_none),
+			// // Toast.LENGTH_LONG);
+			// // toast.setGravity(Gravity.CENTER, 0, 0);
+			// // toast.show();
+			// // break;
+			// // }
+			// // case Network.RESULT_NET_ERROR:
+			// // {
+			// // Toast toast = Toast.makeText(
+			// // ApexTrackingApplication.get_instance(),
+			// // getText(R.string.msg_net_error), Toast.LENGTH_LONG);
+			// // toast.setGravity(Gravity.CENTER, 0, 0);
+			// // toast.show();
+			// // break;
+			// // }
+			// // case Network.RESULT_ERROR:
+			// // // case Network.RESULT_RESPONSE_NULL:
+			// // {
+			// // Toast toast = Toast.makeText(
+			// // ApexTrackingApplication.get_instance(),
+			// // getText(R.string.msg_net_resulterror),
+			// // Toast.LENGTH_LONG);
+			// // toast.setGravity(Gravity.CENTER, 0, 0);
+			// // toast.show();
+			// // break;
+			// // }
+			//
+			// default:
+			// break;
+			// }
 
 			if (success)
 			{
+				JSONObject jsobj;
+				//
+				// array = new JSONArray(json);
+				try
+				{
+					jsobj = new JSONObject(content);
 
-//				if (bfinish)
-//				{
-//					// getListView().removeFooterView(view_page_footer);
-//					// Toast.makeText(AnnouncementActivity.this, "Load all!",
-//					// Toast.LENGTH_LONG).show();
-//
-//					TextView tv = (TextView) view_page_footer
-//							.findViewById(R.id.text_page);
-//					tv.setText("No more items");
-//					tv.setEnabled(false);
-//				}
-//				else
-//				{
-//					TextView tv = (TextView) view_page_footer
-//							.findViewById(R.id.text_page);
-//					tv.setText("More...");
-//					tv.setEnabled(true);
-//				}
-//				adapter.notifyDataSetChanged();
-//				// getListAdapter().notifyDataSetChanged;
-//				// BaseAdapter mJson = null;
-//				// mJson.notifyDataSetChanged();
+					String message = jsobj.getString("message");
+					String date = jsobj.getString("date");
+					String s_id = jsobj.getString("s_id");
+					String e_id = jsobj.getString("e_id");
+					int count = jsobj.getInt("count");
+					SQLiteDatabase db = dbUtil.OpenDB(
+							ApexTrackingApplication.get_instance(), null, true);
+					db.execSQL("insert into push_message(s_id,e_id,msgcount,message,h_time,user,read) values('"
+							+ s_id
+							+ "','"
+							+ e_id
+							+ "',"
+							+ count
+							+ ",'"
+							+ message
+							+ "','"
+							+ date
+							+ "','"
+							+ ApexTrackingApplication.get_user() + "'" + ",0)");
+					dbUtil.CloseDB(db);
+
+					NotificationManager nManager = (NotificationManager) mcontext
+							.getSystemService(Context.NOTIFICATION_SERVICE);
+
+					Notification notification = new Notification(
+							R.drawable.ic_launcher,
+							mcontext.getString(R.string.str_notification_title),
+							System.currentTimeMillis());
+					Intent intent = new Intent(mcontext,
+							FunctionSelectActivity.class);
+					intent.putExtra("launcher", "notification");
+
+					PendingIntent pintent = PendingIntent.getActivity(mcontext,
+							0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
+					notification.defaults = Notification.DEFAULT_ALL;
+					notification.flags = Notification.FLAG_AUTO_CANCEL;
+					notification.number = ApexTrackingApplication.ncount++;
+					if (notification.number > 1)
+						notification
+								.setLatestEventInfo(
+										mcontext,
+										notification.number
+												+ ApexTrackingApplication
+														.get_instance()
+														.getString(
+																R.string.str_mnotification_title),
+										ApexTrackingApplication
+												.get_instance()
+												.getString(
+														R.string.str_notification_text)
+												+ date, pintent);
+					else
+						notification
+								.setLatestEventInfo(
+										mcontext,
+										ApexTrackingApplication
+												.get_instance()
+												.getString(
+														R.string.str_notification_title),
+										ApexTrackingApplication
+												.get_instance()
+												.getString(
+														R.string.str_notification_text)
+												+ date, pintent);
+					nManager.notify(R.layout.activity_apex, notification);
+
+					// notification
+
+				}
+				catch (JSONException e)
+				{
+					// TODO Auto-generated catch block
+					e.printStackTrace();
+				}
+				// if (bfinish)
+				// {
+				// // getListView().removeFooterView(view_page_footer);
+				// // Toast.makeText(AnnouncementActivity.this, "Load all!",
+				// // Toast.LENGTH_LONG).show();
+				//
+				// TextView tv = (TextView) view_page_footer
+				// .findViewById(R.id.text_page);
+				// tv.setText("No more items");
+				// tv.setEnabled(false);
+				// }
+				// else
+				// {
+				// TextView tv = (TextView) view_page_footer
+				// .findViewById(R.id.text_page);
+				// tv.setText("More...");
+				// tv.setEnabled(true);
+				// }
+				// adapter.notifyDataSetChanged();
+				// // getListAdapter().notifyDataSetChanged;
+				// // BaseAdapter mJson = null;
+				// // mJson.notifyDataSetChanged();
 			}
 
 			super.onPostExecute(success);
@@ -178,29 +242,52 @@ public class Alarmreceiver extends BroadcastReceiver
 			// showProgress(false);
 		}
 	}
-	
-	
-	
+
 	@Override
 	public void onReceive(Context context, Intent intent)
 	{
 		String tag = "onReceive@Alarmreceiver";
-        if (intent.getAction().equals("com.usai.apex.push")) {  
-//        	Bundle b = intent.getExtras();
-//        	Set<String> keySet = b.keySet();
-//        	 for(String key : keySet) {
-//        	    Log.e(tag, key);
-//        	 }
-//        	String s =b.getString("caller");
-        	Log.d(tag, "receive alarm broadcast caller =="+intent.getStringExtra("caller"));
-        	
-        	checkpush();
-//            Intent i = new Intent();  
-//            i.setClass(context, DaemonService.class);  
-//            // 启动service   
-//            // 多次调用startService并不会启动多个service 而是会多次调用onStart  
-//            context.startService(i);  
-        }  
+		if (intent.getAction().equals("com.usai.apex.push"))
+		{
+			if(true)
+			return;
+			// Bundle b = intent.getExtras();
+			// Set<String> keySet = b.keySet();
+			// for(String key : keySet) {
+			// Log.e(tag, key);
+			// }
+			// String s =b.getString("caller");
+			Log.d(tag,
+					"receive alarm broadcast caller =="
+							+ intent.getStringExtra("caller"));
+
+			checkpush(context);
+			// Intent i = new Intent();
+			// i.setClass(context, DaemonService.class);
+			// // 启动service
+			// // 多次调用startService并不会启动多个service 而是会多次调用onStart
+			// context.startService(i);
+		}
+		else if (intent.getAction().equals("com.usai.apex.push.cancel"))
+		{
+			if (m_task != null)
+				m_task.cancel(true);
+			NotificationManager nManager = (NotificationManager) context
+					.getSystemService(Context.NOTIFICATION_SERVICE);
+			nManager.cancel(R.layout.activity_apex);
+			ApexTrackingApplication.cancelalarm();
+//			ApexTrackingApplication.put_password("");
+//			ApexTrackingApplication.put_sessionid("");
+//			ApexTrackingApplication.put_user("");
+			ApexTrackingApplication.logout();
+
+			SharedPreferences pref = ApexTrackingApplication.get_instance()
+					.getSharedPreferences("Apex", 0);
+			SharedPreferences.Editor editor = pref.edit();
+
+			editor.putBoolean("autologin", false);
+			editor.commit();
+		}
 	}
 
 }

+ 8 - 6
Apex/src/com/usai/apex/ApexActivity.java

@@ -3,6 +3,7 @@ package com.usai.apex;
 //import com.google.android.gms.maps.SupportMapFragment;
 
 import android.app.ActionBar;
+import android.content.Intent;
 import android.content.pm.PackageInfo;
 import android.content.pm.PackageManager.NameNotFoundException;
 import android.os.Bundle;
@@ -31,7 +32,8 @@ public class ApexActivity extends FragmentActivity /*
 			// myIntent = new Intent(EditActivity.this, tabActivity.class);
 			// startActivity(myIntent);
 			finish();
-			return true;
+			
+			return false;
 		}
 		return super.onKeyDown(keyCode, event);
 	}
@@ -107,20 +109,20 @@ public class ApexActivity extends FragmentActivity /*
 		// // ��ɵײ��Զ�����ʽ�İ�ť
 		// String[] title = new String[] { "Login", "Not login" };
 		// int[] tabIds = new int[] { R.id.tab1, R.id.tab2 };
-		mTabHost.addTab(mTabHost.newTabSpec("Login").setIndicator("Login")
+		mTabHost.addTab(mTabHost.newTabSpec(getString(R.string.action_sign_in_short)).setIndicator(getString(R.string.action_sign_in_short))
 				.setContent(R.id.tab1));
 		// mTabHost.addTab(mTabHost.newTabSpec("test").setIndicator("test").setContent(R.id.tabtest));
 
-		mTabHost.addTab(mTabHost.newTabSpec("Tools").setIndicator("Tools")
+		mTabHost.addTab(mTabHost.newTabSpec(getString(R.string.str_tool)).setIndicator(getString(R.string.str_tool))
 				.setContent(R.id.tab2));
-		mTabHost.addTab(mTabHost.newTabSpec("Service Location")
-				.setIndicator("Service Location").setContent(R.id.tab3));
+		mTabHost.addTab(mTabHost.newTabSpec(getString(R.string.str_location))
+				.setIndicator(getString(R.string.str_location)).setContent(R.id.tab3));
 
 		// Instantiate a new fragment.
 		Fragment loginFragment = new LoginFragment();
 		Fragment toolsFragment = new ToolsFragment();
 		Fragment slFragment;
-		// m_bhasgoogleframework=false;
+		 m_bhasgoogleframework=false;
 		if (m_bhasgoogleframework)
 			slFragment = new ServiceLocationFragment();
 		else

+ 25 - 0
Apex/src/com/usai/apex/ApexPushService.java

@@ -0,0 +1,25 @@
+package com.usai.apex;
+
+import android.app.Service;
+import android.content.Intent;
+import android.os.IBinder;
+
+public class ApexPushService extends Service
+{
+
+	
+//	@Override
+//	public void onCreate()
+//	{
+//		
+//		super.onCreate();
+//	}
+
+	@Override
+	public IBinder onBind(Intent intent)
+	{
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+}

+ 127 - 32
Apex/src/com/usai/apex/ApexTrackingApplication.java

@@ -1,33 +1,77 @@
 package com.usai.apex;
 
+import com.usai.util.Crypto;
+
 import android.app.AlarmManager;
 import android.app.Application;
+import android.app.NotificationManager;
 import android.app.PendingIntent;
 import android.content.Context;
 import android.content.Intent;
+import android.content.SharedPreferences;
 import android.os.SystemClock;
+import android.text.TextUtils;
 import android.util.Log;
 
 public class ApexTrackingApplication extends Application
 {
-	static final String TAG= "ApexTrackingApplication";
-	private static ApexTrackingApplication instance;
-	private static String m_sessionid="";
-	private static String m_user="";
-	private static String m_password="";
-	
- 
+	static final String						TAG				= "ApexTrackingApplication";
+	private static ApexTrackingApplication	instance;
+	private static String					m_sessionid		= "";
+	private static String					m_user			= "";
+	private static String					m_password		= "";
+	public static int						ncount			= 1;
+
+	private static boolean					m_bauthorized	= false;
+
 	@Override
 	public void onCreate()
 	{
-		
+
 		// TODO Auto-generated method stub
-		Log.d(TAG,"onCreate");
+		Log.e(TAG, "onCreate");
 		super.onCreate();
 		instance = this;
+
+		SharedPreferences pref = ApexTrackingApplication.get_instance()
+				.getSharedPreferences("Apex", 0);
+		boolean autologin = pref.getBoolean("autologin", false);
+		if (autologin == true)
+		{
+
+			String u = pref.getString("user", null);
+			String p = pref.getString("password", null);
+
+			try
+			{
+				if (!TextUtils.isEmpty(u))
+					m_user = Crypto.decrypt("apexu", u);
+				if (!TextUtils.isEmpty(p))
+					m_password = Crypto.decrypt("apexp", p);
+			}
+			catch (Exception e)
+			{
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
 		startalarm("app start");
+		// Intent serviceintent = new Intent();
+		// serviceintent.setClass(this, ApexPushService.class);
+		//
+		//
+		// startService(serviceintent);
 	}
-	
+
+	// @Override
+	// protected void finalize() throws Throwable
+	// {
+	// NotificationManager nManager = (NotificationManager)
+	// instance.getSystemService(
+	// Context.NOTIFICATION_SERVICE);
+	// nManager.cancel(R.layout.activity_apex);
+	// super.finalize();
+	// }
 
 	public static ApexTrackingApplication get_instance()
 	{
@@ -36,48 +80,99 @@ public class ApexTrackingApplication extends Application
 
 	public static void startalarm(String caller)
 	{
-		
-        // 启动完成  
-        Intent iAlarm = new Intent(get_instance(), Alarmreceiver.class);  
-        iAlarm.putExtra("caller", caller);
-        iAlarm.setAction("com.usai.apex.push");  
-        PendingIntent sender = PendingIntent.getBroadcast(get_instance(), 0,  
-        		iAlarm, PendingIntent.FLAG_UPDATE_CURRENT);  
-        
-        long firstime = SystemClock.elapsedRealtime();  
-        AlarmManager am = (AlarmManager) get_instance()  
-                .getSystemService(Context.ALARM_SERVICE);  
-
-        // 10秒一个周期,不停的发送广播  
-        am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, firstime,  
-                30 * 1000, sender);  
+
+		// 启动完成
+		Intent iAlarm = new Intent(get_instance(), Alarmreceiver.class);
+		iAlarm.putExtra("caller", caller);
+		iAlarm.setAction("com.usai.apex.push");
+		PendingIntent sender = PendingIntent.getBroadcast(get_instance(), 0,
+				iAlarm, PendingIntent.FLAG_UPDATE_CURRENT);
+
+		long firstime = SystemClock.elapsedRealtime();
+		AlarmManager am = (AlarmManager) get_instance().getSystemService(
+				Context.ALARM_SERVICE);
+
+		// 10秒一个周期,不停的发送广播
+		am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, firstime,
+				30 * 1000, sender);
 	}
-	public static void put_sessionid(String id)
+
+	public static void cancelalarm()
 	{
 
-		m_sessionid = id;
+		// 启动完成
+		Intent iAlarm = new Intent(get_instance(), Alarmreceiver.class);
+		iAlarm.setAction("com.usai.apex.push");
+		PendingIntent sender = PendingIntent.getBroadcast(get_instance(), 0,
+				iAlarm, PendingIntent.FLAG_UPDATE_CURRENT);
+
+		AlarmManager am = (AlarmManager) get_instance().getSystemService(
+				Context.ALARM_SERVICE);
+
+		am.cancel(sender);
 	}
-	public static void put_user(String user)
+
+	public static void logout()
 	{
-		
-		m_user = user;
+		m_sessionid = "";
+		m_user = "";
+		m_password = "";
+		m_bauthorized = false;
 	}
-	public static void put_password(String pass)
+	public static void login(String sid,String user,String pass)
 	{
-		
+		m_sessionid = sid;
+		m_user = user;
 		m_password = pass;
+		m_bauthorized = true;
 	}
 
+//	public static void put_sessionid(String id)
+//	{
+//
+//		Log.e(TAG, "put_sessionid");
+//		m_sessionid = id;
+//	}
+
+//	public static void put_authorization(boolean bauth)
+//	{
+//
+//		m_bauthorized = bauth;
+//	}
+
+	public static boolean get_authorization()
+	{
+
+		return m_bauthorized;
+	}
+
+//	public static void put_user(String user)
+//	{
+//
+//		m_user = user;
+//	}
+//
+//	public static void put_password(String pass)
+//	{
+//
+//		m_password = pass;
+//	}
+
 	public static String get_sessionid()
 	{
+		Log.e(TAG, "get_sessionid");
 		return m_sessionid;
 	}
+
 	public static String get_user()
 	{
+		Log.e(TAG, "get_user");
 		return m_user;
 	}
+
 	public static String get_pass()
 	{
+		Log.e(TAG, "get_pass");
 		return m_password;
 	}
 }

+ 348 - 0
Apex/src/com/usai/apex/BaiduMapFragment.java

@@ -5,18 +5,32 @@ package com.usai.apex;
 //import baidumapsdk.demo.DemoApplication;
 //import baidumapsdk.demo.DemoApplication.MyGeneralListener;
 
+import java.util.ArrayList;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+
+
 import com.baidu.mapapi.BMapManager;
 import com.baidu.mapapi.MKGeneralListener;
+import com.baidu.mapapi.map.ItemizedOverlay;
 import com.baidu.mapapi.map.MKEvent;
 import com.baidu.mapapi.map.MapController;
+import com.baidu.mapapi.map.MapView;
+import com.baidu.mapapi.map.OverlayItem;
 import com.baidu.mapapi.map.SupportMapFragment;
 import com.baidu.platform.comapi.basestruct.GeoPoint;
+import com.usai.util.Network;
 
 import android.content.Context;
+import android.graphics.drawable.Drawable;
+import android.os.AsyncTask;
 import android.os.Bundle;
 import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentManager;
 import android.util.Log;
+import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -24,11 +38,342 @@ import android.widget.Toast;
 
 public class BaiduMapFragment extends Fragment
 {
+	private SearchTask				m_task				= null;
+	String							fragment_content	= null;
+	private MapView mMapView = null;
+	private MyOverlay mOverlay = null;	
+//	private OverlayItem mCurItem = null;
+//	private Button button = null;
+	private ArrayList<OverlayItem>  mItems = null; 
+	
 	SupportMapFragment fragment;
     BMapManager mBMapManager = null;
     public static boolean m_bKeyRight = true;
     public static final String strKey = "tznWFxd3RvSoul1TGQp6GSzo";
     
+    public class MyOverlay extends ItemizedOverlay{
+
+		public MyOverlay(Drawable defaultMarker, MapView mapView) {
+			super(defaultMarker, mapView);
+		}
+		
+
+		@Override
+		public boolean onTap(int index){
+//			OverlayItem item = getItem(index);
+//			mCurItem = item ;
+//			if (index == 3){
+//				button.setText("这是一个系统控件");
+//				GeoPoint pt = new GeoPoint((int) (mLat4 * 1E6),
+//						(int) (mLon4 * 1E6));
+//				// 弹出自定义View
+//				pop.showPopup(button, pt, 32);
+//			}
+//			else{
+//			   popupText.setText(getItem(index).getTitle());
+//			   Bitmap[] bitMaps={
+//				    BMapUtil.getBitmapFromView(popupLeft), 		
+//				    BMapUtil.getBitmapFromView(popupInfo), 		
+//				    BMapUtil.getBitmapFromView(popupRight) 		
+//			    };
+//			    pop.showPopup(bitMaps,item.getPoint(),32);
+//			}
+			return true;
+		}
+		
+//		@Override
+//		public boolean onTap(GeoPoint pt , MapView mMapView){
+////			if (pop != null){
+////                pop.hidePop();
+////                mMapView.removeView(button);
+////			}
+//			return false;
+//		}
+    	
+    }   
+	void AddMarker()
+	{
+		
+		if (mMapView == null)
+		{
+
+			Log.d("onResume", "get map from fragment");
+			mMapView = fragment.getMapView();
+			if (mMapView == null)
+				return;
+		}
+
+
+		try
+		{
+			JSONObject jsobj = new JSONObject(fragment_content);
+
+			int count = jsobj.getInt("total");
+
+			JSONObject objrecords = jsobj.getJSONObject("records");
+			
+
+
+			for (int i = 0; i < count; i++)
+			{
+				// offset++;
+				
+				
+				
+				JSONObject objrec = objrecords.getJSONObject("record" + i);
+				String area = objrec.getString("area");
+				String company = objrec.getString("company");
+				String city = objrec.getString("city");
+				String longitude = objrec.getString("longitude");
+				String latitude = objrec.getString("latitude");
+				String address = objrec.getString("address");
+				String telephone = objrec.getString("telephone");
+				String fax = objrec.getString("fax");
+				String contact = objrec.getString("contact");
+				String email = objrec.getString("email");
+
+
+				LocationDetail detail = new LocationDetail(company, address,
+						telephone, fax, contact, email);
+				
+				
+		         mOverlay = new MyOverlay(getResources().getDrawable(R.drawable.ic_marker),mMapView);	
+		         /**
+		          * 准备overlay 数据
+		          */
+		         GeoPoint p1 = new GeoPoint ((int)(Double.parseDouble(latitude)*1E6),(int)(Double.parseDouble(longitude)*1E6));
+		         OverlayItem item1 = new OverlayItem(p1,company,city+"\n"+area);
+//		         /**
+//		          * 设置overlay图标,如不设置,则使用创建ItemizedOverlay时的默认图标.
+//		          */
+//		         item1.setMarker(getResources().getDrawable(R.drawable.icon_marka));
+//		         
+//		         GeoPoint p2 = new GeoPoint ((int)(mLat2*1E6),(int)(mLon2*1E6));
+//		         OverlayItem item2 = new OverlayItem(p2,"覆盖物2","");
+//		         item2.setMarker(getResources().getDrawable(R.drawable.icon_markb));
+//		         
+//		         GeoPoint p3 = new GeoPoint ((int)(mLat3*1E6),(int)(mLon3*1E6));
+//		         OverlayItem item3 = new OverlayItem(p3,"覆盖物3","");
+//		         item3.setMarker(getResources().getDrawable(R.drawable.icon_markc));
+//
+//		         GeoPoint p4 = new GeoPoint ((int)(mLat4*1E6),(int)(mLon4*1E6));
+//		         OverlayItem item4 = new OverlayItem(p4,"覆盖物4","");
+//		         item4.setMarker(getResources().getDrawable(R.drawable.icon_gcoding));
+		         /**
+		          * 将item 添加到overlay中
+		          * 注意: 同一个itme只能add一次
+		          */
+		         mOverlay.addItem(item1);
+//		         mOverlay.addItem(item2);
+//		         mOverlay.addItem(item3);
+//		         mOverlay.addItem(item4);				
+
+		         /**
+		          * 保存所有item,以便overlay在reset后重新添加
+		          */
+		         mItems = new ArrayList<OverlayItem>();
+		         mItems.addAll(mOverlay.getAllItem());
+
+//				// 初始化 ground 图层
+//				mGroundOverlay = new GroundOverlay(mMapView);
+//				GeoPoint leftBottom = new GeoPoint((int) (mLat5 * 1E6),
+//						(int) (mLon5 * 1E6));
+//				GeoPoint rightTop = new GeoPoint((int) (mLat6 * 1E6),
+//						(int) (mLon6 * 1E6));
+//				Drawable d = getResources().getDrawable(R.drawable.ground_overlay);
+//				Bitmap bitmap = ((BitmapDrawable) d).getBitmap();
+//				mGround = new Ground(bitmap, leftBottom, rightTop);
+
+		         /**
+		          * 将overlay 添加至MapView中
+		          */
+		         mMapView.getOverlays().add(mOverlay);
+//		         mMapView.getOverlays().add(mGroundOverlay);
+//		         mGroundOverlay.addGround(mGround);
+		         /**
+		          * 刷新地图
+		          */
+		         mMapView.refresh();
+//		         mResetBtn.setEnabled(false);
+//		         mClearBtn.setEnabled(true);
+			}
+		}
+		catch (JSONException e)
+		{
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+	public void requestloactions()
+	{
+
+		if (m_task != null)
+		{
+			return;
+		}
+
+		if (fragment_content != null)
+		{
+			// LayoutInflater inflater = (LayoutInflater)
+			// ApexTrackingApplication
+			// .get_instance().getSystemService(
+			// Context.LAYOUT_INFLATER_SERVICE);
+			// init(fragment_content,inflater);
+			return;
+		}
+		// mStatusMessageView.setText(R.string.str_Loading);
+		// showProgress(true);
+		m_task = new SearchTask();
+
+		// TextView text_page = (TextView) view_page_footer
+		// .findViewById(R.id.text_page);
+		// text_page.setText("Loading...");
+		// text_page.setEnabled(false);
+		m_task.execute();
+
+	}
+	
+	class SearchTask extends AsyncTask<Void, Void, Boolean>
+	{
+		int	errorcode;
+
+		// boolean bfinish = false;
+
+		@Override
+		protected Boolean doInBackground(Void... params)
+		{
+			Log.d("SearchTask", "doInBackground");
+			if (!Network.NetworkIsAvailable())
+
+			{
+				errorcode = Network.RESULT_NET_NOTAVAILABLE;
+				return false;
+			}
+			String jstr = Network.get_servicelocation();
+
+			if (jstr == null || jstr.length() <= 0)
+			{
+				// Log.d(TAG, "json is wrong");
+
+				errorcode = Network.RESULT_NET_ERROR;
+				return false;
+			}
+
+			JSONObject jsobj;
+			//
+			// array = new JSONArray(json);
+			try
+			{
+				jsobj = new JSONObject(jstr);
+				// if (searchresult.get_fieldscount() == 0)
+				// {
+				// JSONObject objfields = jsobj.getJSONObject("fields");
+				// if (objfields != null)
+				// searchresult.init_fields(objfields.toString());
+				// }
+				int count = jsobj.getInt("total");
+				// if (count < limit)
+				// bfinish = true;
+				JSONObject objrecords = jsobj.getJSONObject("records");
+				if (objrecords != null)
+				{
+					fragment_content = jstr;
+					errorcode = Network.RESULT_TRUE;
+
+					return true;
+				}
+			}
+			catch (JSONException e)
+			{
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+			errorcode = Network.RESULT_NET_ERROR;
+			return false;
+		}
+
+		@Override
+		protected void onPostExecute(Boolean success)
+		{
+			Log.i("onPostExecute", "entry");
+			m_task = null;
+			// showProgress(false);
+
+			switch (errorcode)
+			{
+				case Network.RESULT_NET_NOTAVAILABLE:
+				{
+					Toast toast = Toast.makeText(
+							ApexTrackingApplication.get_instance(),
+							getText(R.string.msg_connection_none),
+							Toast.LENGTH_LONG);
+					toast.setGravity(Gravity.CENTER, 0, 0);
+					toast.show();
+					break;
+				}
+				case Network.RESULT_NET_ERROR:
+				{
+					Toast toast = Toast.makeText(
+							ApexTrackingApplication.get_instance(),
+							getText(R.string.msg_net_error), Toast.LENGTH_LONG);
+					toast.setGravity(Gravity.CENTER, 0, 0);
+					toast.show();
+					break;
+				}
+				case Network.RESULT_ERROR:
+				// case Network.RESULT_RESPONSE_NULL:
+				{
+					Toast toast = Toast.makeText(
+							ApexTrackingApplication.get_instance(),
+							getText(R.string.msg_net_resulterror),
+							Toast.LENGTH_LONG);
+					toast.setGravity(Gravity.CENTER, 0, 0);
+					toast.show();
+					break;
+				}
+
+				default:
+					break;
+			}
+
+			if (success)
+			{
+				AddMarker();
+				//
+				// if (bfinish)
+				// {
+				// // getListView().removeFooterView(view_page_footer);
+				// // Toast.makeText(AnnouncementActivity.this, "Load all!",
+				// // Toast.LENGTH_LONG).show();
+				//
+				// TextView tv = (TextView) view_page_footer
+				// .findViewById(R.id.text_page);
+				// tv.setText("No more items");
+				// tv.setEnabled(false);
+				// }
+				// else
+				// {
+				// TextView tv = (TextView) view_page_footer
+				// .findViewById(R.id.text_page);
+				// tv.setText("More...");
+				// tv.setEnabled(true);
+				// }
+				// adapter.notifyDataSetChanged();
+				// // getListAdapter().notifyDataSetChanged;
+				// // BaseAdapter mJson = null;
+				// // mJson.notifyDataSetChanged();
+			}
+
+			super.onPostExecute(success);
+		}
+
+		@Override
+		protected void onCancelled()
+		{
+			m_task = null;
+			// showProgress(false);
+		}
+	}
 	public void initEngineManager(Context context) {
         if (mBMapManager == null) {
             mBMapManager = new BMapManager(context);
@@ -84,6 +429,7 @@ public class BaiduMapFragment extends Fragment
 		
 		FragmentManager fm = getChildFragmentManager();
 		fragment = (SupportMapFragment) fm.findFragmentById(R.id.map);
+		
 		if (fragment == null)
 		{
 			
@@ -91,6 +437,7 @@ public class BaiduMapFragment extends Fragment
 			fragment = SupportMapFragment.newInstance();;// .newInstance();
 			fm.beginTransaction().replace(R.id.map, fragment).commit();
 		}
+		mMapView = fragment.getMapView();
 	}
 
 	@Override
@@ -99,6 +446,7 @@ public class BaiduMapFragment extends Fragment
 	{
 		// TODO Auto-generated method stub
 //		return super.onCreateView(inflater, container, savedInstanceState);
+		requestloactions();
 		return inflater.inflate(R.layout.fragment_service_location, container,
 				false);
 	}

+ 8 - 0
Apex/src/com/usai/apex/BootBroadcastReceiver.java

@@ -2,6 +2,8 @@ package com.usai.apex;
 
 
 
+
+
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
@@ -26,6 +28,12 @@ public class BootBroadcastReceiver extends BroadcastReceiver
 //            // 10秒一个周期,不停的发送广播  
 //            am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, firstime,  
 //                    30 * 1000, sender);  
+//			Intent intentservice = new Intent();
+//			intentservice.setClass(context, ApexPushService.class);
+//			if (intent.getExtras() != null)
+//				intentservice.putExtras(intent.getExtras());
+//			intentservice.setAction(intent.getAction());
+//			context.startService(intentservice);
         	ApexTrackingApplication.startalarm("boot completed");
         } 
 		else if (intent.getAction().equals(

+ 3 - 3
Apex/src/com/usai/apex/ChangePasswordActivity.java

@@ -252,9 +252,9 @@ public class ChangePasswordActivity extends Activity {
 					public void onClick(DialogInterface dialog, int which) {
 						dialog.dismiss();
 
-						ApexTrackingApplication.put_password(m_snewPassword);
-						
-						ChangePasswordActivity.this.finish();
+//						ApexTrackingApplication.put_password(m_snewPassword);
+						setResult(Activity.RESULT_OK, null);
+						finish();
 					}
 				});
 

+ 2 - 2
Apex/src/com/usai/apex/CustomizeFieldsActivity.java

@@ -167,14 +167,14 @@ public class CustomizeFieldsActivity extends Activity implements
 		// {
 		// navList.add("Aѡ��" + i);
 		// }
-		list.add(new fieldedit("Display fields", -1));
+		list.add(new fieldedit(getString(R.string.str_displayitem), -1));
 		list.addAll(showList);
 
 		// for (int i = 0; i <18; i++)
 		// {
 		// moreList.add("Bѡ��" + i);
 		// }
-		list.add(new fieldedit("Hide fields", -2));
+		list.add(new fieldedit(getString(R.string.str_hideitem), -2));
 		list.addAll(hideList);
 		dbUtil.CloseCursor(cursor);
 		dbUtil.CloseDB(db);

+ 4 - 4
Apex/src/com/usai/apex/DetailFragment.java

@@ -330,11 +330,11 @@ public class DetailFragment extends Fragment implements OnClickListener /*
 							getActivity();
 							AlertDialog.Builder builder = new Builder(
 									getActivity());
-							builder.setMessage("Click start button to begin download");
+							builder.setMessage(getString(R.string.str_downloadmessage));
 
-							builder.setTitle("Confirm download");
+							builder.setTitle(getString(R.string.str_confirmdownload));
 
-							builder.setPositiveButton("Start",
+							builder.setPositiveButton(getString(R.string.str_download),
 									new Dialog.OnClickListener() {
 
 										@Override
@@ -348,7 +348,7 @@ public class DetailFragment extends Fragment implements OnClickListener /*
 										}
 									});
 
-							builder.setNegativeButton("Cancel",
+							builder.setNegativeButton(getString(R.string.str_cancel),
 									new Dialog.OnClickListener() {
 
 										@Override

+ 62 - 71
Apex/src/com/usai/apex/FunctionSelectActivity.java

@@ -1,7 +1,9 @@
 package com.usai.apex;
 
 import android.app.ActionBar;
+import android.app.Activity;
 import android.content.Intent;
+import android.content.SharedPreferences;
 import android.os.Bundle;
 import android.support.v4.app.FragmentActivity;
 import android.util.Log;
@@ -15,11 +17,9 @@ import android.widget.TextView;
 public class FunctionSelectActivity extends FragmentActivity implements
 		OnClickListener
 {
-	// String user=null;
-	// String password=null;
-	// Cursor m_cur_container_no, m_cur_hbol;
-	// SQLiteDatabase m_db;
-	// SimpleCursorAdapter history_adapter;
+
+	private static final int	REQUEST_LOGINACTIVITY			= 1;
+	private static final int	REQUEST_CHANGEPASSWORD_ACTIVITY	= 2;
 
 	@Override
 	protected void onCreate(Bundle savedInstanceState)
@@ -55,54 +55,46 @@ public class FunctionSelectActivity extends FragmentActivity implements
 		Button btn_clear = (Button) findViewById(R.id.btn_clear);
 		btn_clear.setOnClickListener(this);
 
-		// m_db = dbUtil.OpenDB(this, null, true);
-		// m_cur_container_no = m_db.query("search_history", new String[] {
-		// "h_val", "_id" }, "h_field='container_no' and user='"
-		// + ApexTrackingApplication.get_user() + "'", null, null, null,
-		// "h_time", null);
-		// startManagingCursor(m_cur_container_no);
-		//
-		// m_cur_hbol = m_db.query("search_history",
-		// new String[] { "h_val", "_id" }, "h_field='hbol' and user='"
-		// + ApexTrackingApplication.get_user() + "'", null, null,
-		// null, "h_time", null);
-		// startManagingCursor(m_cur_hbol);
-		//
-		// AutoCompleteTextView atv_criterion = (AutoCompleteTextView)
-		// findViewById(R.id.atv_criterion);
-		// history_adapter = new SimpleCursorAdapter(this,
-		// R.layout.dropdown_item,
-		// m_cur_hbol, new String[] { "h_val" },
-		// new int[] { R.id.drop_item });
-		// atv_criterion.setAdapter(history_adapter);
+		SharedPreferences pref = ApexTrackingApplication.get_instance()
+				.getSharedPreferences("Apex", 0);
+		boolean autologin = pref.getBoolean("autologin", false);
+
+		if (!autologin)
+		{
+			Intent i = new Intent();
+			i.setClass(this, ApexActivity.class);
+			startActivityForResult(i, REQUEST_LOGINACTIVITY);
+		}
 
-//		RadioGroup rg = (RadioGroup) findViewById(R.id.radioGroup1);
-		// rg.setOnCheckedChangeListener(new OnCheckedChangeListener(){
-		//
-		// @Override
-		// public void onCheckedChanged(RadioGroup group, int checkedId)
-		// {
-		// if(checkedId==R.id.radio0)
-		// {
-		// history_adapter.swapCursor(m_cur_hbol);
-		// }
-		// else
-		// {
-		// history_adapter.swapCursor(m_cur_container_no);
-		//
-		// }
-		//
-		// }
-		//
-		// });
 	}
 
-	// @Override
-	// public boolean onCreateOptionsMenu(Menu menu) {
-	// // Inflate the menu; this adds items to the action bar if it is present.
-	// getMenuInflater().inflate(R.menu.function_select, menu);
-	// return true;F
-	// }
+	@Override
+	protected void onActivityResult(int requestCode, int resultCode, Intent data)
+	{
+		switch (requestCode)
+		{
+			case REQUEST_LOGINACTIVITY:
+				if (resultCode == Activity.RESULT_CANCELED)
+					finish();
+				break;
+			case REQUEST_CHANGEPASSWORD_ACTIVITY:
+				if (resultCode == Activity.RESULT_OK)
+				{
+					String UNIQUE_STRING = "com.usai.apex.push.cancel";
+					Intent intent = new Intent(UNIQUE_STRING);
+					sendBroadcast(intent);
+					Intent i = new Intent();
+					i.setClass(this, ApexActivity.class);
+					startActivityForResult(i, 1);
+				}
+				break;
+			default:
+				break;
+		}
+
+
+		super.onActivityResult(requestCode, resultCode, data);
+	}
 
 	@Override
 	protected void onDestroy()
@@ -157,25 +149,9 @@ public class FunctionSelectActivity extends FragmentActivity implements
 					intent.putExtra("criterion_type", 1);
 					h_field = "container_no";
 				}
-//				String user = ApexTrackingApplication.get_user();
-				// long h_time = System.currentTimeMillis();
-				// int count = dbUtil
-				// .get_count(m_db, "search_history", "user='" + user
-				// + "' and h_field='" + h_field + "'");
-				// if (count < 10)
-				// {
-				// m_db.execSQL("insert into search_history(h_val,h_field,h_time,user) values('"
-				// + cargo_criterion + "','" + h_field +
-				// "',"+h_time+",'"+user+"')");
-				// }
-				// {
-				// int _id=dbUtil.get_recordid(m_db, "search_history", "user='"
-				// + user
-				// + "' and h_field='" + h_field + "'", "h_time");
-				// m_db.execSQL("update search_history set h_val='"+cargo_criterion+"' , h_time='"+h_time+"' where _id="+_id);
-				// }
+
 				startActivity(intent);
-				// }
+
 				break;
 			}
 			case R.id.tv_booking:
@@ -238,13 +214,28 @@ public class FunctionSelectActivity extends FragmentActivity implements
 				Intent intent = new Intent();
 				intent.setClass(this, ChangePasswordActivity.class);
 				// intent.putExtra("function_name", "Container detail");
-				startActivity(intent);
+				startActivityForResult(intent, REQUEST_CHANGEPASSWORD_ACTIVITY);
 				break;
 			}
 			case R.id.tv_exit:
 			{
-				finish();
-				System.exit(0);
+				String UNIQUE_STRING = "com.usai.apex.push.cancel";
+				Intent intent = new Intent(UNIQUE_STRING);
+				// intent.putExtra("key1", "value1");
+				// intent.putExtra("key2", "value2");
+				sendBroadcast(intent);
+
+				// ApexTrackingApplication.cancelalarm();
+				// ApexTrackingApplication.put_password("");
+				// ApexTrackingApplication.put_sessionid("");
+				// ApexTrackingApplication.put_user("");
+
+				Intent i = new Intent();
+				i.setClass(this, ApexActivity.class);
+				startActivityForResult(i, 1);
+
+				// finish();
+				// System.exit(0);
 				break;
 			}
 			case R.id.tv_about:

+ 10 - 5
Apex/src/com/usai/apex/LoginFragment.java

@@ -7,6 +7,7 @@ import com.usai.util.Network;
 
 import android.animation.Animator;
 import android.animation.AnimatorListenerAdapter;
+import android.app.Activity;
 //import android.app.Fragment;
 import android.content.Context;
 import android.content.Intent;
@@ -343,22 +344,26 @@ public class LoginFragment extends Fragment/* implements OnClickListener */
 								Crypto.encrypt("apexu", m_sUser));
 						editor.putString("password",
 								Crypto.encrypt("apexp", m_sPassword));
+						editor.putBoolean("autologin", true);
 					} else {
 						editor.putString("user", null);
 						editor.putString("password", null);
+						editor.putBoolean("autologin", false);
 					}
 				} catch (Exception e) {
 					editor.putString("user", null);
 					editor.putString("password", null);
+					editor.putBoolean("autologin", false);
 					e.printStackTrace();
 				}
 				editor.commit();
 
-				Intent intent = new Intent();
-				intent.setClass(getActivity(), FunctionSelectActivity.class);
-//				intent.putExtra("user", m_sUser);
-//				intent.putExtra("password", m_sPassword);
-				startActivity(intent);
+//				Intent intent = new Intent();
+//				intent.setClass(getActivity(), FunctionSelectActivity.class);
+////				intent.putExtra("user", m_sUser);
+////				intent.putExtra("password", m_sPassword);
+//				startActivity(intent);
+				getActivity().setResult(Activity.RESULT_OK, null);
 				getActivity().finish();
 			} else {
 				switch (errorcode) {

+ 24 - 20
Apex/src/com/usai/apex/ResultActivity.java

@@ -51,8 +51,8 @@ public class ResultActivity extends Activity
 	String				password		= null;
 	String				function_name	= null;
 	private SearchTask	m_task			= null;
-	
-	final int OFFSET = 5;
+
+	final int			OFFSET			= 5;
 
 	int					sel				= -1;
 
@@ -234,8 +234,9 @@ public class ResultActivity extends Activity
 		}
 		else
 			tv_head.setText(/*
-							 * loadcount + "/" +
-//							 */searchresult.get_totalcount() + getText(R.string.str_records).toString());
+							 * loadcount + "/" + //
+							 */searchresult.get_totalcount()
+					+ getText(R.string.str_records).toString());
 		TableLayout tl = (TableLayout) findViewById(R.id.result_table);
 
 		tl.removeViews(1, tl.getChildCount() - 1);
@@ -273,7 +274,7 @@ public class ResultActivity extends Activity
 			HashMap<String, String> record = searchresult.get_record(i);
 			TextView field = new TextView(ResultActivity.this);
 			field.setBackgroundResource(R.drawable.tableitem);
-			field.setText(searchresult.get_offset() + i +1+ "");
+			field.setText(searchresult.get_offset() + i + 1 + "");
 			Log.d("offset=" + searchresult.get_offset(), "");
 			field.setGravity(Gravity.CENTER);
 			field.setPadding(10, 5, 10, 5);
@@ -282,7 +283,7 @@ public class ResultActivity extends Activity
 			for (int j = 0; j < showfieldmap.size(); j++)
 			{
 				TextView field1 = new TextView(ResultActivity.this);
-//				Log.d("onPostExecute", showfieldmap.get(j));
+				// Log.d("onPostExecute", showfieldmap.get(j));
 				String str = record.get(showfieldmap.get(j));
 				field1.setBackgroundResource(R.drawable.tableitem);
 				if (str.toLowerCase().trim().equals("null"))
@@ -299,8 +300,8 @@ public class ResultActivity extends Activity
 						@Override
 						public void onClick(View v)
 						{
-//							if (true)
-//								return;
+							// if (true)
+							// return;
 							URLSpan span[] = ((TextView) v).getUrls();
 							if (span.length < 1)
 								return;
@@ -334,11 +335,12 @@ public class ResultActivity extends Activity
 
 							AlertDialog.Builder builder = new Builder(
 									ResultActivity.this);
-							builder.setMessage("Click start button to begin download");
+							builder.setMessage(getString(R.string.str_downloadmessage));
 
-							builder.setTitle("Confirm download");
+							builder.setTitle(getString(R.string.str_confirmdownload));
 
-							builder.setPositiveButton("Start",
+							builder.setPositiveButton(
+									getString(R.string.str_download),
 									new Dialog.OnClickListener()
 									{
 
@@ -347,14 +349,14 @@ public class ResultActivity extends Activity
 												DialogInterface dialog,
 												int which)
 										{
-											downloadManager
-													.enqueue(request);
+											downloadManager.enqueue(request);
 											dialog.dismiss();
 
 										}
 									});
 
-							builder.setNegativeButton("Cancel",
+							builder.setNegativeButton(
+									getString(R.string.str_cancel),
 									new Dialog.OnClickListener()
 									{
 
@@ -392,7 +394,8 @@ public class ResultActivity extends Activity
 		{
 			btnpre.setEnabled(true);
 		}
-		if ((searchresult.get_totalcount() - searchresult.get_offset() <= OFFSET)||(searchresult.get_totalcount()==0))
+		if ((searchresult.get_totalcount() - searchresult.get_offset() <= OFFSET)
+				|| (searchresult.get_totalcount() == 0))
 			btnnext.setEnabled(false);
 		else
 			btnnext.setEnabled(true);
@@ -408,10 +411,11 @@ public class ResultActivity extends Activity
 																ContextMenuInfo contextmenuinfo)
 														{
 
-															contextmenu.add(
-																	Menu.NONE,
-																	0, 0,
-																	"Detail");
+															contextmenu
+																	.add(Menu.NONE,
+																			0,
+																			0,
+																			getString(R.string.str_detail));
 
 														}
 
@@ -641,7 +645,7 @@ public class ResultActivity extends Activity
 
 			if (params[0])
 			{
-				int ret = Network.get_recordcount( searchParms);
+				int ret = Network.get_recordcount(searchParms);
 				if (ret >= 0)
 				{
 					searchresult.put_totalcount(ret);

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
Apex/src/com/usai/apex/ServiceLocationFragment.java


Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff