WebService
MySQL
데이터베이스에서 하나의 Listview
애플 리케이션을 개발했습니다. 내 데이터베이스에 다음 1 개가 삽입됩니다.이 시간 (새로운 주문이 삽입되었습니다) 알림 메시지가 내 android device.now i에 표시된다는 것을 의미합니다 알림 메시지를 클릭하면 해당 응용 프로그램이 실행 된 시간을 의미하고 각각의 모든 주문이 내 MySQL
데이터베이스에 삽입되면 Listview
가 자동으로 성공적으로 표시됩니다. 어떤 방법이 여기에서 사용됩니까? 도와주세요.푸시 알림을 안드로이드 애플 리케이션
이 내 RetailerActivity.java
코드 :
public class RetailerActivity extends Activity {
ListView list;
private static final String SOAP_ACTION = "http://xcart.com/customerData1";
private static final String METHOD_NAME = "customerData1";
private static final String NAMESPACE = "http://xcart.com";
private static final String URL = "http://192.168.1.168:8089/XcartLogin/services/RetailerWs?wsdl";
private static final String KEY_STATUS = "status";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
HttpTransportSE ht = new HttpTransportSE(URL);
try {
ht.call(SOAP_ACTION, envelope);
SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
SoapPrimitive s = response;
String str = s.toString();
String resultArr[] = str.split("&");
list=(ListView)findViewById(R.id.list);
list.setAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1,resultArr));
list.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
String status = parent.getItemAtPosition(position).toString();
String[] status1 = status.split(" ");
String StrStatus = status1[1].toString();
Intent in = new Intent(getApplicationContext(), SingleMenuItemActivity.class);
in.putExtra(KEY_STATUS, StrStatus);
startActivity(in);
}
});
}
catch (Exception e) {
e.printStackTrace();
}
}
}
성공적으로 내 데이터베이스에 삽입되는 새로운 질서를 displayed.but하는 Listview
을에 여기하시기 바랍니다 새로운 질서가 삽입되는 시간을 의미 Notification
메시지의 안드로이드 장치에 표시됩니다. 이제는 알림 메시지를 클릭해야합니다. 즉, 디스플레이 업데이트 Listview
입니다. 어떻게 할 수 있습니까 ???????? 내가 사용하는 방법은 무엇입니까? 리스트 뷰에 새로운 데이터에서 데이터를 가져 오는 경우
새로 고침 ur listView ... ur listView.getAdapter(). notifyDataSetChanged() ... ur resultArr이 변경되었음을 확인하십시오. – sheetal
안드로이드 기기에서 푸시 알림 메시지가 필요합니다. ? 어떤 방법이든 ... (예) c2dm 또는 gcm – user1676640