本页文章导读:
▪APNS相干记录 APNS相关记录
APNS服务器组有两组,一组是development时用的,地址是gateway.sandbox.push.apple.com,另一组是发布时用的,地址为gateway.push.apple.com,端口均为2195
......
▪ <uses-sdk>的设定与UI相关联 <uses-sdk>的设定与UI有关联
在做一个TabHost的练习时,发现在清单文件中是否设置
<uses-sdk android:minSdkVersion="8" />
会导致相同的程序呈现不同的界面:
设置<uses-sdk android:minSdkVers.........
▪ Notification跟NotificationManager的使用 Notification和NotificationManager的使用
//主要代码
package com.ck;
import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Intent;
import.........
[1]APNS相干记录
来源: 互联网 发布时间: 2014-02-18
APNS相关记录
APNS服务器组有两组,一组是development时用的,地址是gateway.sandbox.push.apple.com,另一组是发布时用的,地址为gateway.push.apple.com,端口均为2195
APNS服务器组有两组,一组是development时用的,地址是gateway.sandbox.push.apple.com,另一组是发布时用的,地址为gateway.push.apple.com,端口均为2195
[2] <uses-sdk>的设定与UI相关联
来源: 互联网 发布时间: 2014-02-18
<uses-sdk>的设定与UI有关联
在做一个TabHost的练习时,发现在清单文件中是否设置
<uses-sdk android:minSdkVersion="8" />
会导致相同的程序呈现不同的界面:
设置<uses-sdk android:minSdkVersion="4" /> 对应Android SDK1.6
则与不设置相同的效果
如果设置为5,6,7,8 ; 则效果发生改变
[3] Notification跟NotificationManager的使用
来源: 互联网 发布时间: 2014-02-18
Notification和NotificationManager的使用
//主要代码 package com.ck; import android.app.Activity; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class NotificationActivity extends Activity { private Button button1,button2; private Notification n; private NotificationManager nm; private static final int ID = 1; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); button1 = (Button)findViewById(R.id.button1); button2 = (Button)findViewById(R.id.button2); nm = (NotificationManager)getSystemService(NOTIFICATION_SERVICE); n = new Notification(); int icon = n.icon = R.drawable.ic_launcher; String test = "this is notification speaking,,"; long when = System.currentTimeMillis(); n.icon = icon; n.tickerText = test; n.when = when; button1.setOnClickListener(sendListener); button2.setOnClickListener(cancelListener); } private OnClickListener sendListener = new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub Intent intent = new Intent(NotificationActivity.this,SecondActivity.class); PendingIntent pi = PendingIntent.getActivity(getApplicationContext(), 0, intent, 0); n.setLatestEventInfo(getApplicationContext(), "ck", "chenkai", pi); nm.notify(ID,n); } }; private OnClickListener cancelListener = new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub nm.cancel(ID); } }; }
最新技术文章: