- 浏览: 60209 次
最新评论
文章列表
<?php
/*
* Created on 2012-8-8
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
//$server = "172.**.*.**";
//$username = "sa";
//$password = "123456";
//$server = "172.**. ...
<?php
/*
* Created on 2013-1-17
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
//连接数据库
$link = mysql_connect("127.0.0.1", "root", "root") or die("Could not connect:" . mys ...
Button或者ImageButton的背景设为透明或者半透明
半透明<Button android:background="#e0000000" ... />
透明<Button android:background="#00000000" ... />
颜 色和不透明度 (alpha) 值以十六进制表示法表示。任何一种颜色的值范
围都是 0 到 255(00 到 ff)。对于 alpha,00 表示完全透明,ff 表示
完全不透明。表达式顺序是“aabbggrr”,其中“aa=alpha”(00 到 ...
1.
private final static String DATABASE_PATH = android.os.Environment
.getExternalStorageDirectory().getAbsolutePath() + "/citypro";
private final static String PATH_USE = "MyData";
2.
// 复制数据库
boolean blcunzai = checkgpsdb();
if (!blcunzai) {
// 复制数据 ...
1.保存数据
SharedPreferences userInfo = getSharedPreferences(
"user_info", 0);
userInfo.edit().putString("Sessionid", Sessionid)
.commit();
userInfo.edit()
.putString("PhoneNumber",
etPhoneNumber.getText().toString())
...
private String uploadPicture( String uploadFile )
{
String resultcode = "1";//0表示成功 ,1表示失败
HttpClient httpclient = new DefaultHttpClient();
httpclient.getParams( ).setParameter( CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1 );
HttpPost httpp ...
// 获得手机分辨率
DisplayMetrics dm = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(dm);
String s = dm.widthPixels + "*" + dm.heightPixels;
// listview 因分辨率而异
if (s.equals("480*800") || s.equals("480*854"))
FixStyle.setListViewHeig ...
/* 发送邮件的地址 */
Uri uri = Uri.parse("mailto:fengsheng.studio@hotmail.com");
/* 创建Intent */
Intent it = new Intent(Intent.ACTION_SENDTO, uri);
/* 设置邮件的主题 */
it .putExtra(android.content.Intent.EXTRA_SUBJECT, "数据备份");
/* 设置邮件的内容 */
it .pu ...
<application
加:
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity
加:
android:screenOrientation="portrait"
代码中:
/* 设置为无标题栏 */
requestWindowFeature(Window.FEATURE_NO_TITLE);
/* 设 ...
public static void quit(Context context) {
AlertDialog.Builder alertbBuilder = new AlertDialog.Builder(context);
alertbBuilder.setTitle("您确定需要退出?")
.setPositiveButton("确定", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface di ...
<uses-permission android:name="android.permission.INTERNET" />
TextView tv = new TextView(this);
String myString = null;
try
{
/* 定义我们要访问的地址url */
URL uri = new URL("http://192.***.*.***:8080/android.txt");
/* 打开这个url连接 */
URLConnect ...
EditText继承关系:View-->TextView-->EditText
EditText的属性很多,这里介绍几个:
android:hint="请输入数字!"//设置显示在空间上的提示信息
android:numeric="integer"//设置只能输入整数,如果是小数则是:decimal
android:singleLine="true"//设置单行输入,一旦设置为true,则文字不会自动换行。
android:password="true"//设置只能输入密码
androi ...
private boolean CheckNetwork() {
boolean flag = false;
ConnectivityManager cwjManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
if (cwjManager.getActiveNetworkInfo() != null)
flag = cwjManager.getActiveNetworkInfo().isAvailable();
if (!flag) {
Builder b = n ...
private final static String ALBUM_PATH = Environment
.getExternalStorageDirectory() + "/image/";
private List<String> filenames = new ArrayList<String>();
private void createFileName(String path) {
String[] arrpath = path.split("/");
File sdcardfile;
Stri ...
/**
* 读取网络图片
*
* @author ysh
*
*/
public static Bitmap getBitmap(String url) {
Bitmap bt = null;
if (url != null && !url.equals("")) {
InputStream is = null;
try {
URL url1 = new URL(url);
HttpURLConnection conn = (HttpURLConnection) url1
...