android之location 根据接口获取经纬度信息
摘要:http://maps.googleapis.com/maps/api/geocode/json?address=%E7%A6%8F%E5%BB%BA&sensor=false
http://maps.googleapis.com/maps/api/geocode/xml?address=%E7%A6%8F%E5%BB%BA&sensor=false
http://maps.googleapis.com/maps/api/geocode/json?latlng=31.02,117.12&sensor=false
http://maps.googleapis.com/maps/api/geocode/xml?latlng=31.02,117.12&sensor=false
http://maps.googleapis.com/maps/api/geocode/json?address=%E7%A6%8F%E5%BB%BA&sensor=false
http://maps.googleapis.com/maps/api/geocode/json?address=%E7%A
阅读全文
posted @
2014-04-26 01:10
上校
阅读(1990)
推荐(0) 编辑
android之location03
摘要:private class ButtonListener implements OnClickListener
{
@Override
public void onClick(View v) {
//得到LocationManager对象
LocationManager locationManager=(LocationManager)MainActivity.this.getSystemService(Context.LOCATION_SERVICE);
//定义当前所使用的Location Provider
//第二个参数:隔多少秒更新一次 第三个参数:隔多少距离更新一次
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 5000, new TestLocationListener());
阅读全文
posted @
2014-04-26 01:08
上校
阅读(417)
推荐(0) 编辑
android之location02
摘要:package com.example.mars_3300_location02;
import java.net.ContentHandler;
import java.util.List;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.content.Context;
阅读全文
posted @
2014-04-26 01:06
上校
阅读(337)
推荐(0) 编辑
android之location01
摘要:
LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
阅读全文
posted @
2014-04-25 22:51
上校
阅读(200)
推荐(0) 编辑
android之蓝牙设备的使用01
摘要:
TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
阅读全文
posted @
2014-04-24 00:07
上校
阅读(308)
推荐(0) 编辑
使用gson-1.6.jar解析json
摘要:package com.example.mars_2900_json01;
import java.io.StringReader;
import java.lang.reflect.Type;
import java.util.Iterator;
import java.util.LinkedList;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.google.gson.stream.JsonReader;
public class JsonUtils {
public static void parseJson(String jsonData) {
try {
// 如果需要解析JSON数据,首要要生成一个JsonReader对象
阅读全文
posted @
2014-04-23 23:04
上校
阅读(1904)
推荐(0) 编辑
android之Widget01
摘要:ExampleAppWidgetProvider.java
package com.example.mars_2600_widget01;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.content.Intent;
public class ExampleAppWidgetProvider extends AppWidgetProvider{
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
super.onReceive(context, intent);
阅读全文
posted @
2014-04-20 12:07
上校
阅读(275)
推荐(0) 编辑
android之RatingBar控件用法
摘要:MainActivity.java
package com.example.mars_2500_ratingbar;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
阅读全文
posted @
2014-04-19 18:13
上校
阅读(10529)
推荐(0) 编辑
android之SeekBar控件用法
摘要:MainActivity.java
package com.example.mars_2400_seekbar;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
阅读全文
posted @
2014-04-19 17:42
上校
阅读(8612)
推荐(0) 编辑
android之ExpandableListActivity
摘要:MainActivity.java
package com.example.mars_2300_expandablelist;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.app.ExpandableListActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
阅读全文
posted @
2014-04-19 17:30
上校
阅读(1293)
推荐(0) 编辑
android之AutoCompleteTextView控件用法
摘要:
AutoCompleteTextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android
阅读全文
posted @
2014-04-19 14:25
上校
阅读(2361)
推荐(0) 编辑
android之Spinner控件用法
摘要:用法1:
Spinner android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/Spinner
阅读全文
posted @
2014-04-19 14:07
上校
阅读(18860)
推荐(1) 编辑
android之datepicker控件用法
摘要:package com.example.mars_2200_datepicker;import java.util.Calendar;import android.support.v7.app.ActionBarActivity;import android.support.v7.app.Actio...
阅读全文
posted @
2014-04-19 14:04
上校
阅读(4108)
推荐(0) 编辑
Android学习路线
摘要:第一阶段:Java面向对象编程
1.Java基本数据类型与表达式,分支循环。
2.String和StringBuffer的使用、正则表达式。
3.面向对象的抽象,封装,继承,多态,类与对象,对象初始化和回收;构造函数、this关键字、方法和方法的参数传递过程、static关键字、内部类,Java的垃极回收机制,Javadoc介绍。
4.对象实例化过程、方法的覆盖、final关键字、抽象类、接口、继承的优点和缺点剖析;对象的多态性:子类和父类之间的转换、抽象类和接口在多态中的应用、多态带来的好处。
5.Java异常处理,异常的机制原理。
6.常用的设计模式:Singleton、Template、Strategy模式。
7.JavaAPI介绍:种基本数据类型包装类,System和Runtime类,Date和DateFomat类等。
8.Java集合介绍:Collection、Set、List、ArrayList、Vector、LinkedList、Hashset、TreeSet、Map、HashMap、TreeMap、Iterator、Enumeratio
阅读全文
posted @
2014-04-17 23:48
上校
阅读(30804)
推荐(9) 编辑
WebView用法
摘要:在Android手机中内置了一款高性能webkit内核浏览器,在SDK中封装为一个叫做WebView组件。
什么是webkit
WebKit是Mac OS X v10.3及以上版本所包含的软件框架(对v10.2.7及以上版本也可通过软件更新获取)。 同时,WebKit也是Mac OS X的Safari网页浏览器的基础。WebKit是一个开源项目,主要由KDE的KHTML修改而来并且包含了一些来自苹果公司的一些组件。
传统上,WebKit包含一个网页引擎WebCore和一个脚本引擎JavaScriptCore,它们分别对应的是KDE的KHTML和KJS。不过, 随着JavaScript引擎的独立性越来越强,现在WebKit和WebCore已经基本上混用不分(例如Google Chrome和Maxthon 3采用V8引擎,却仍然宣称自己是WebKit内核)。
阅读全文
posted @
2014-04-07 19:18
上校
阅读(504)
推荐(0) 编辑
Android之Service
摘要:1.自定义Service类
package com.example.mars_2000_service;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
public class FirstService extends Service {
@Override
public IBinder onBind(Intent intent) {
System.out.println("Service onBind");
return null;
}
阅读全文
posted @
2014-04-07 16:24
上校
阅读(307)
推荐(0) 编辑
android-Service和Thread的区别
摘要:1.服务不是单一的进程。服务没有自己的进程,应用程序可以不同,服务运行在相同的进程中。
2.服务不是线程。可以在线程中工作。
一.在应用中,如果是长时间的在后台运行,而且不需要交互的情况下,使用服务。
同样是在后台运行,不需要交互的情况下,如果只是完成某个任务,之后就不需要运行,而且可能是多个任务,需需要长时间运行的情况下使用线程。
二.如果任务占用CPU时间多,资源大的情况下,要使用线程。
阅读全文
posted @
2014-04-07 16:09
上校
阅读(2235)
推荐(0) 编辑
控制WIFI状态
摘要:1.控制WIFI
public class MainActivity extends Activity {
private Button startButton = null;
private Button stopButton = null;
private Button checkButton = null;
private WifiManager wifiManager = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
阅读全文
posted @
2014-04-07 15:19
上校
阅读(1915)
推荐(0) 编辑
Android之BroadcastReceiver 监听系统广播
摘要:绑定广播有两种方式
一.配置文件绑定,在程序未启动也能监听
二.代码方式绑定,在程序启动后才能监听
1.绑定和取消绑定广播
public class MainActivity extends Activity {
private Button registerButton=null;
private Button unRegisterButton=null;
private SMSReceiver smsReceiver=null;
阅读全文
posted @
2014-04-07 14:09
上校
阅读(13534)
推荐(0) 编辑
Android之BroadcastReceiver1
摘要:1.触发发送广播
public class MainActivity extends Activity {
private Button sendButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
阅读全文
posted @
2014-04-07 12:04
上校
阅读(360)
推荐(0) 编辑