文章分类 -  Android学习

在0425中才发现的关于Could not find xxx.apk!
摘要:好久没有在eclipse下面写东西了,今天写了一个东西,在手机上面运行,发现提示[2011-04-25 14:19:41 - StandardSensorTest] Android Launch![2011-04-25 14:19:41 - StandardSensorTest] adb is running normally.[2011-04-25 14:19:41 - StandardSensorTest] Could not find StandardSensorTest.apk!以前可以运行的很多工程也是提示这个信息,到模拟器上面运行发现提示,什么空间不足。百度第一个问题,得到解决办法 阅读全文
posted @ 2011-04-25 14:27 snowdrop 阅读(5402) 评论(0) 推荐(0)
更新android sdk至2.3以及以上版本,出现Please ensure that adb is correctly located at '/android-sdk-linux_86/platform-tools/adb' an..
摘要:错误提示:[2011-02-24 17:29:36 - StyleTest1] Android Launch![2011-02-24 17:29:36 - StyleTest1] The connection to adb is down, and a severe error has occured.[2011-02-24 17:29:36 - StyleTest1] You must restart adb and Eclipse.[2011-02-24 17:29:36 - StyleTest1] Please ensure that adb is correctly located a 阅读全文
posted @ 2011-02-25 09:47 snowdrop 阅读(11100) 评论(0) 推荐(0)
android 布局中的间隔线
摘要:在显示的视图中加一条间隔线,不像ListView里面的那种虚线,而是一条实线如果是LinearLayout布局,必须要在<View/>的属性里面指定宽和高两个属性,否则就会出错,如果是TableLayout布局,只需要指定高这个属性就可以了xml布局如下:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?xml version="1.0" encoding="utf-8"?> 阅读全文
posted @ 2010-12-22 16:30 snowdrop 阅读(24082) 评论(0) 推荐(1)
android Broadcast学习
摘要:其实所谓的静态注册,动态注册,是指接收广播的时候,是静态注册接收还是动态注册接收,发送的时候不分静态,动态以发送intent为例,一共分4种情况,以每次注册两个Broadcast为例:情况一,注册2个静态Broadcast如果是静态注册的,接收的一定是某一个类继承BroadcastReceiver2个java文件如下:BroadcastActivity.java代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->package com.bro 阅读全文
posted @ 2010-12-15 14:28 snowdrop 阅读(23783) 评论(0) 推荐(3)
关于在eclipse里面导入android sdk的samples里面自带的例子的时候,出现No projects are found to import的问题
摘要:记得以前直接import,import exsiting projects就可以,不知道为什么这次导入的时候,总是出现这个,在网上搜索,学习http://www.devdiv.net/bbs/thread-34441-1-1.html,才知道,在new Android Project里面换一个选项create project from existing,即可。。学习了,嘿嘿。。 阅读全文
posted @ 2010-12-02 20:48 snowdrop 阅读(3457) 评论(0) 推荐(0)
点击一个按钮,弹出一个对话框,对弹出的对话框进行配置
摘要:activity代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->package com.dialog.test1;import android.app.Activity;import android.app.AlertDialog;import android.content.DialogInterface;import android.os.Bundle;import android.widget.Button;import andro 阅读全文
posted @ 2010-12-01 16:21 snowdrop 阅读(20286) 评论(0) 推荐(0)
界面之间的跳转,一种是setContentView,一种是activity
摘要:1、用setContentView方法各个文件定义layout2.xml代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:ori 阅读全文
posted @ 2010-11-29 17:52 snowdrop 阅读(12770) 评论(0) 推荐(0)
学习sdk范例总结1--不断更新ing
摘要:1、Textview内容设置及显示不管什么情况,必须在xml中先声明TextView(可以不设置android:text) 可以在xml中或者在java中设置TextView文本内容,下面只说如何在java中设置, 1.1 TextView对象.setText();支持一下多态构造方法而TextView.setText不支持HTML TAG的输出,比如:text01.setText("<a href=\"http://www.baidu.com\">博客</a>");不会把这个地址做为链接显示,而是显示<a href=\&q 阅读全文
posted @ 2010-11-27 11:32 snowdrop 阅读(646) 评论(0) 推荐(0)
TextView文字跑马灯效果(学习别人加自己总结)
摘要:两种方法法一、在main.xml中实现代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:orientation="ver 阅读全文
posted @ 2010-10-20 11:25 snowdrop 阅读(41246) 评论(1) 推荐(0)
linux和android查找命令
摘要:转自http://www.sudu.cn/info/html/edu/20060619/176242.html1 、关于搜索; 在Linux文件系统中,搜索概念有两种,一种是搜索文件名,另一种是在一个文件中搜索指定的内容;这两种搜索,我们都简要的介绍一下,但不一定极为专业。想到哪写到哪; 2、通过搜索文件名来查找文件; 有的弟兄经常会说文件都放在哪里了,我怎么查找文件?其实这里说的意思就是通过文件名来查找文件所处的位置;搜索文件名,我们常用的工具有find、locate、where等。目前我们简单的说一说这几个工具在文件系统中,通过查找文件名的方法来查看其所在的位置; 2.1 find... 阅读全文
posted @ 2010-09-15 18:50 snowdrop 阅读(9606) 评论(0) 推荐(0)
android直接找一个文件,部分编译等实用
摘要:从网上看的别人的:在android的顶层目录里,运行下面的命令:source build/envsetup.sh运行命令后,就添加了很多命令到sh解释器,具体命令如下:-croot: Changes directory to the top ofthe tree.-m: Makes from the top of the tree.-mm: Builds all of the modules in thecurrent directory.-mmm: Builds all of the modules in thesupplied directories.-cgrep: Greps on al 阅读全文
posted @ 2010-09-10 17:01 snowdrop 阅读(1872) 评论(0) 推荐(0)
经典常用判断字符串是否有值
摘要:比如做一个输入框,可以判断是否在输入框里面输入了值:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->package com.java.test;publicclass T {publicstaticvoid main(String args[]) {String name=" hhhhh jjjj ";//经典判断字符串是否有值的方法if((name!=null)&&(name.trim().lengt 阅读全文
posted @ 2010-09-07 09:00 snowdrop 阅读(702) 评论(0) 推荐(0)
String的常用方法(持续更新中)
摘要:1、indexOf:返回指定子字符串在此字符串中第一次出现的索引值。(1)例子:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->package com.java.test;publicclass T {publicstaticvoid main(String args[]) {String s ="hahaheihei";String s1 ="ha";String s2 ="h" 阅读全文
posted @ 2010-09-01 09:08 snowdrop 阅读(274) 评论(0) 推荐(0)
void 方法中的return语句,跳出的范围
摘要:void 方法中的return语句,跳出的范围是他所在的上层方法的块,不是整个类,也不是他的上一级括号例子:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->package com.java.test;publicclass T {int countNumber=4;publicvoid test(){if(countNumber >0){countNumber --;System.out.println(countNumber);r 阅读全文
posted @ 2010-09-01 09:04 snowdrop 阅读(4810) 评论(0) 推荐(0)
android Service 的简单使用(学习别人)
摘要:1、要使用Service,首先就是在配置文件里吗添加Service,如果不填加,你的Service是不能够使用的。目前学到的方法有两种 方法一:<service android:enabled="true" android:name=".PlayService" /> 方法二:<service android:name=".PlayService" /> 点后面是Service类的名字。2、工程包括两个类:ServiceActivity.javaPlayService.java其中:ServiceActivit 阅读全文
posted @ 2010-08-24 11:22 snowdrop 阅读(57215) 评论(0) 推荐(1)
把本地下载的apk放到手机里面
摘要:在普通用户权限下面,运行su,然后运行adb push 本地apk所在的目录,具体到/apk 手机里的目录,如sdcard然后push成功后,去手机里面的“文件管理“里面去查看自己刚才push的apk,点击安装即可。 阅读全文
posted @ 2010-08-20 16:04 snowdrop 阅读(433) 评论(0) 推荐(0)
分离activity和监听类续(更好!)
摘要:这个工程包括两个类:1、SensorActivity.java2、SensorListenerTest.java在SensorActivity里面可以不用监听,就可以完成自己想要的动作。1、SensorActivity.java代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->package com.sener.listener;import android.app.Activity;import android.content.Conte 阅读全文
posted @ 2010-08-18 17:57 snowdrop 阅读(832) 评论(0) 推荐(0)
在一个工程(包)下面让activity和SensorEventListener监听分离,在不同类中完成
摘要:两个类:1、SensorTest类,是Acvitivity2、SensorListenerTest类,实现了SensorEventListener类,SensorTest.java:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->package com.sensor;import android.app.Activity;import android.os.Bundle;public class SensorTest extends Ac 阅读全文
posted @ 2010-08-18 10:09 snowdrop 阅读(4210) 评论(0) 推荐(0)
在一个页面中点击menu按钮,添加几个菜单项,点击相应的菜单项,能执行相应的操作
摘要:一、一级菜单代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->在某个页面中点击menu按钮,添加几个菜单项,点击相应的菜单项,能执行相应的操作java代码如下:package com.event;import android.app.Activity;import android.app.AlertDialog;import android.app.ProgressDialog;import android.app.AlertDialog. 阅读全文
posted @ 2010-05-14 11:08 snowdrop 阅读(5591) 评论(0) 推荐(0)
实现两个Button,一个TextView的点击
摘要:方法一:用implements onClickListener实现代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->package com.listen;import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.View.OnClickListener;im 阅读全文
posted @ 2010-05-13 11:40 snowdrop 阅读(3389) 评论(0) 推荐(1)