qixiinghaitang

博客园 首页 新随笔 联系 订阅 管理
  32 Posts :: 2 Stories :: 24 Comments :: 0 Trackbacks

公告

置顶随笔 #

摘要: Android学习指南基础篇文章目录课程描述第一讲:Android开发环境的搭建第二讲:Android系统构架分析和应用程序目录结构分析第三讲:Android模拟器的使用emulator第四讲:Activity入门指南Activity第五讲:用户界面 View(一)FrameLayout, LinearLayout第六讲:用户界面 View(二)AbsoluteLayout,RelativeLayout第七讲:用户界面 View(三)TableLayout第八讲:Intent入门指南Intent第九讲:用户界面 View(四)Button TextView EditView CheckBoxR阅读全文
posted @ 2011-03-17 21:09 qixiinghaitang 阅读(1909) 评论(1) 编辑

摘要: Android是Google于2007年11月5日宣布的基于Linux平台的开源手机操作系统的名称,该平台由操作系统、中间件、用户界面和应用软件组成,号称是首个为移动终端打造的真正开放和完整的移动软件。 本文汇总整理了时下关于Google Android技术教程的下载资源,供参考。 一、入门级: 《Android中文教程》中文版 [简介]:《Android中文教程》简单易懂,对初学Android的人来说有着很好的帮助。 [下载]:http://www.apkbus.com/forum.php?mod=viewthread&tid=2950 《Android中文教程》中文版 [简介]:《阅读全文
posted @ 2011-03-12 14:22 qixiinghaitang 阅读(4687) 评论(3) 编辑

摘要: 《Android应用程序开发》http://www.apkbus.com/forum.php?mod=viewthread&tid=61&extra=page%3D1《Android应用开发揭秘》下载http://www.apkbus.com/forum.php?mod=viewthread&tid=126&extra=page%3D1Android英文版书籍 Pro.Android.2含源码http://www.apkbus.com/forum.php?mod=viewthread&tid=74&extra=page%3D1《Android程序阅读全文
posted @ 2011-03-11 17:09 qixiinghaitang 阅读(995) 评论(5) 编辑

2011年8月21日 #

   Android 快捷方式是桌面最基本的组件。它用于直接启动某一应用程序的某个组件。

       一般情况下,可以在Launcher的应用程序列表上,通过长按某一个应用程序的图标在左面上创建改该应用程序的快捷方式。另外,还可以通过两种方式在桌面上添加快捷方式:
       一:在应用程序中创建一个Intent,然后以Broadcast的形式通知Launcher创建一个快捷方式。
       二:为应用程序的组件注册某一个符合特定条件的IntentFilter,然后可以直接在Launcher的桌面添加启动该组件的快捷方式。

       下面模拟在应用程序中添加快捷方式

main.xml布局文件

java代码:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" 
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<Button android:id="@+id/createShortcut"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="20px"
android:text="创建快捷键"/>

<Button android:id="@+id/exit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="20px"
android:text="退出"/>
</LinearLayout>

  

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="eoe.demo" android:versionCode="1"
android:versionName="1.0">

<application android:icon="@drawable/icon"
android:label="@string/app_name">
<activity android:name=".ShortCutAction"
android:label="@string/app_name">
<intent-filter>

<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

</application>
<uses-sdk android:minSdkVersion="7" />

<!-- 添加快捷键权限 -->
<uses-permission
android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
</manifest>

    ShortCutAction类


java代码

package apkbus.demo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Parcelable;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

/**
* 通过应用程序创建快捷方式
* 
* @author jiqinlin
*
*/

public class ShortCutAction extends Activity implements OnClickListener{
private Button createShortcut=null; //创建快捷键按钮
private Button exit=null;//退出系统

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

createShortcut=(Button)findViewById(R.id.createShortcut);
exit=(Button)findViewById(R.id.exit);
createShortcut.setOnClickListener(this);
exit.setOnClickListener(this);
}

public void onClick(View v) {
//Button btn=(Button)v;
switch (v.getId()) {
case R.id.createShortcut:
//String title=getResources().getString(R.string.title);
Intent addIntent=new Intent("com.android.launcher.action.INSTALL_SHORTCUT");
Parcelable icon=Intent.ShortcutIconResource.fromContext(this, R.drawable.png); 
//获取快捷键的图标
Intent myIntent=new Intent(this, ShortCutAction.class);
addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "快捷方式");//快捷方式的标题
addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, icon);//快捷方式的图标
addIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, myIntent);//快捷方式的动作
sendBroadcast(addIntent);//发送广播
break;
case R.id.exit:
System.exit(0);
break;
}
}
}

  

 本文转载自:安卓巴士 http://www.apkbus.com/forum.php?mod=viewthread&tid=12930&extra=


posted @ 2011-08-21 21:56 qixiinghaitang 阅读(63) 评论(0) 编辑

 原理概述:

        手机电池电量的获取在应用程序的开发中也很常用,Android系统中手机电池电量发生变化的消息是通过Intent广播来实现的,常用的Intent的Action有  Intent.ACTION_BATTERY_CHANGED(电池电量发生改变时)、Intent.ACTION_BATTERY_LOW(电池电量达到下限时)、和Intent.ACTION_BATTERY_OKAY(电池电量从低恢复到高时)。

        当需要在程序中获取电池电量的信息时,需要为应用程序注册BroadcastReceiver组件,当特定的Action事件发生时,系统将会发出相应的广播,应用程序就可以通过BroadcastReceiver来接受广播,并进行相应的处理。

       main.xml布局文件

java代码:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" 
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ToggleButton android:id="@+id/tb"
android:layout_width="fill_parent"
android:layout_height="wrap_content" 
android:textOn="停止获取电量信息"
android:textOff="获取电量信息" />
<TextView android:id="@+id/tv" 
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>

  BatteryActivity类


java代码:

package eoe.demo;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.widget.CompoundButton;
import android.widget.TextView;
import android.widget.ToggleButton;
import android.widget.CompoundButton.OnCheckedChangeListener;

public class BatteryActivity extends Activity {
private ToggleButton tb=null;
private TextView tv=null;
private BatteryReceiver receiver=null;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

receiver=new BatteryReceiver();
tv=(TextView)findViewById(R.id.tv);
tb=(ToggleButton)findViewById(R.id.tb);
tb.setOnCheckedChangeListener(new OnCheckedChangeListener(){

public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {
//获取电池电量

if(isChecked){
IntentFilter filter=new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
registerReceiver(receiver, filter);//注册BroadcastReceiver
}else {
//停止获取电池电量
unregisterReceiver(receiver);
tv.setText(null);
}

}
});

}

private class BatteryReceiver extends BroadcastReceiver{

@Override
public void onReceive(Context context, Intent intent) {
int current=intent.getExtras().getInt("level");//获得当前电量
int total=intent.getExtras().getInt("scale");//获得总电量
int percent=current*100/total;
tv.setText("现在的电量是"+percent+"%。");
}
}

}

  本文转载自:安卓巴士 http://www.apkbus.com/forum.php?mod=viewthread&tid=12927



posted @ 2011-08-21 21:52 qixiinghaitang 阅读(176) 评论(0) 编辑

2011年8月7日 #

安卓巴士开发1群105776293(未满) 
安卓巴士开发2群84048564(未满) 
安卓巴士开发3群160767382(未满) 
机器人团队官方群152082960(未满) 
安卓巴士网高校群2 ]146537495(未满) 
安卓巴士(给力Android)  75061372(未满)

由于论坛建的十几个群已经满了,以上是安卓巴士的巴友建的群,大家可以加进去哈

www.apkbus.com   安卓巴士-android开发交流论坛


由于论坛群有限,只能加一个群,谢谢各位巴友,希望大家体谅

posted @ 2011-08-07 10:07 qixiinghaitang 阅读(129) 评论(0) 编辑

2011年6月21日 #

android常用控件介绍
      ------文本框(TextView
      ------列表(ListView
      ------提示(Toast
      ------编辑框(EditText
      ------下拉列表(Spinner
      ------自动提示(AutoCompleteTextViewMultiAutoCompleteTextView
      ------日期和时间(DatePicker、TimePicker
      ------按钮(Button
      ------菜单(Menu,SubMenu,MenuItem
      ------对话框(Dialog
      ------图片视图(ImageView
      ------带图标的按钮(ImageButton
      ------拖动效果(Gallery
      ------切换图片(ImageSwitcher
      ------网格视图(GridView)
      ------文卷轴视图(ScrollView
      ------进度条(ProgressBar
      ------拖动条(SeekBar
      ------状态栏提示(Notification、NotificationManager
      ------对话框中的进度条(ProgressDialog
      ------单项选择(RadioGroup、RadioButton
posted @ 2011-06-21 22:15 qixiinghaitang 阅读(271) 评论(0) 编辑

2011年6月16日 #

很多网友转型Android开发或准备做一个Android开发者,到底做哪方面的好呢? 下面是安卓巴士给大家的一些建议:

 

  1. 过去是J2EE、J2SE的开发者,这类传统的Java开发者可以考虑继续做Android应用开发,如果会SSH,可以做更好的服务性客户端等等。

 

  2. 过去时J2ME的开发者,大部分可能都是做游戏出身的,考虑Android游戏开发相对比较理想。

 

  3.  过去是C\C++程序员或有些基础,可以考虑Android应用开发,熟悉后可以做一些更深入的应用通过NDK,Android NDKr5还对STL部分特性做了支持,比较实用。

 

  4. 过去是WinCE、Maemo或硬件相关的,可以考虑ROM定制,移植方面的,对于Android Framework层的学习是主要的。

 

  5. 过去搞硬件的、单片机的可以试试Android ADK,有关ADK是什么Android开发网在以前的文章中介绍过,可以做出一些硬件配件来。

 

  到底是做应用薪水高还是底层呢? 这里安卓巴士就形势而言应用挂广告,尤其是游戏效果会远比做底层和内核的好,国内较著名的愤怒的小鸟就是一个比较典型的例子,相对而言用户看到的是应

用,做底层的只能比较低调了,但做一款内核级的应用还是不错的。

posted @ 2011-06-16 09:56 qixiinghaitang 阅读(243) 评论(0) 编辑

2011年6月12日 #

Windows Phone 7开发学习之《项目模板》


Windows Phone 7开发学习之《工程结构》



Windows Phone 7开发学习之《音乐播放示例》



Windows Phone 7开发学习之《应用程序生命周期》



Windows Phone 7开发学习之《页面导航》



Windows Phone 7开发学习之《数据绑定与应用程序栏》



Windows Phone 7开发学习之《使用Expression Blend 创建应用程序栏》



Windows Phone 7开发学习之《独立存储空间》



Windows Phone 7开发学习之《启动器与选择器》



Windows Phone 7开发学习之《程序性能分析器》



Windows Phone 7开发学习之《推送通知服务》



Windows Phone 7开发学习《ListBox 数据与Android ListView 数据绑定》



Windows Phone 7开发学习之《画图》



Windows Phone 7开发学习《Control Toolkit--静态和动态的ContextMenu》



Windows Phone 7开发学习之《创建用户控件》
 
Windows Phone 7开发学习之DeepZoom 详细使用方法



Windows Phone 7开发学习Expression Blend 创建渐变效果创建Storyboard

posted @ 2011-06-12 10:55 qixiinghaitang 阅读(598) 评论(1) 编辑

2011年6月6日 #

摘要: 本系列教程稍后会做成文档,希望大家继续关注Windows Phone 7 hello worldWindows Phone 7 布局与大小Windows Phone 7 触摸编程-单点触摸利用Touch.FrameReported事件Windows Phone 7 位图编程Windows Phone 7 入门-XAML语法介绍Windows Phone 7(accelerometer)重力感应编程Windows Phone 7 软件体系结构Windows Phone 7 配置文件WMAppmanifest.xml的介绍Windows Phone 7 button控件Windows Phone 阅读全文
posted @ 2011-06-06 10:47 qixiinghaitang 阅读(1198) 评论(5) 编辑

摘要: Android程式设计(29)-Android应用程式的剖析 Android程式设计(28)-如何将Eclipse中文化及方便的小工具DroidDraw Android程式设计(27)-如何用非Eclipse平台来建立专案,以「Hello,Android!」专案说明 Android程式设计(26)-如何进行专案除错,以「Hello,Android!」专案说明 Android程式设计(25)-如何将介面升级到以XML方式来排版,以「Hello,Android!」专案说明 Android程式设计(24)-执行程式码,以「Hello,Android!」专案说明 Android程式设计(23)-如何.阅读全文
posted @ 2011-06-06 10:01 qixiinghaitang 阅读(149) 评论(0) 编辑

2011年6月2日 #

摘要: Android 技术专题系列之一 -- Android 是什么Android 技术专题系列之二 -- telephonyAndroid 技术专题系列之三 -- 编译(build) 流程Android 技术专题系列之四 -- 网络资源及常见命令备Android 技术专题系列之五 -- 本地化Android 技术专题系列之六 --如何安装.apk到模拟Android 技术专题系列之七 -- 输入法 框架Android 技术专题系列之八 -- 浏览器及web widgetAndroid 技术专题系列之九 -- 图形系统Android 技术专题系列之十 -- Audio managerAndroid 阅读全文
posted @ 2011-06-02 16:20 qixiinghaitang 阅读(235) 评论(1) 编辑

2011年5月14日 #

摘要: 1Android之动画效果编程基础2使用Gson将Java对象转换为Json3Android之桌面组件App Widget案例4Android之桌面组件App Widget初探5Android之实时文件夹6Android之快捷方式二——向Launcher添加快捷方式7Android之快捷方式一——通过应用程序创建快捷方式8Android之手机闹钟9Android之手机电池电量应用10Android之TelephonyManager类的使用案例11Android之TelephonyManager类的方法详解12Android之音量调节13Android之手机振动的设置14Android之手机壁纸阅读全文
posted @ 2011-05-14 11:25 qixiinghaitang 阅读(283) 评论(1) 编辑

仅列出标题  下一页