`
mickey_hou
  • 浏览: 237652 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论
文章列表
下载apk程序代码 protected File downLoadFile(String httpUrl) {                 // TODO Auto-generated method stub                 final String fileName = "updata.apk";                 File tmpFile = new File("/sdcard/update");                 if (!tmpFile.exists()) {                      ...
    public static Intent getVideoFileIntent(String param)     {                 Intent intent = new Intent("android.intent.action.VIEW");         intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);         intent.putExtra("oneshot", 0);         intent.putExtra("configchange&quo ...
/**      * 判断该应用在手机中的安装情况      * @param PackageManager pm  ,String packageName int ,versionCode      * @param packageName  要判断应用的包名      * @param versionCode     要判断应用的版本号      */     private int doType(PackageManager pm, String packageName, int versionCode)     {         List<PackageInfo> paka ...
private static int INSTALLED = 0; // 表示已经安装,且跟现在这个apk文件是一个版本         private static int UNINSTALLED = 1; // 表示未安装         private static int INSTALLED_UPDATE = 2; // 表示已经安装,版本比现在这个版本要低,可以点击按钮更新         private Context context;         private List<MyFile> myFiles = new ArrayList<MyFile&g ...
package com.example.dynamicimage; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import ...
<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="fill_parent"     android:layout_height="fill_pare ...
public class PlayerVideoTest extends Activity implements OnClickListener,OnSeekBarChangeListener {         private ImageView btnPause, btnPlay, btnStop;         private SurfaceView surfaceView;         private SeekBar skbProgress;         private PlayerVideo player;         private int progress ...
public class PlayerVideo implements OnBufferingUpdateListener,OnCompletionListener,OnPreparedListener,Callback {     private int videoWidth,videoHeight;         private SeekBar skbProgress; //进度条         public MediaPlayer mediaPlayer; //播放器         private SurfaceHolder surfaceHolder;         ...
1.创建一个SD卡镜像文件 命令窗口进入sdk的tool目录下,创建sd卡镜像。 输入如下命令:mksdcard 1024M E:\Mysdcard\sdcard.img mksdcard是命令,1024M是指定sd卡大小,最后面是要创建的sd卡的路径,不能有中文。 该命令会在指定路径下生成一个sdcard.img文件, 该文件就是Android模拟器的SD卡镜像文件。 1024M表示1024兆,即该SD卡有1个G的容量,也可用K做单位(1M=1024K),K,M必须大写。 目前Android支持8M~128G的SD卡。 2.关联SD卡和模拟器 就是让模拟器知道它的SD卡是谁,路径 ...
/*          * 设置首页加载   延时3秒          */         new Handler().postDelayed(new Runnable()         {                         public void run()             {                 /*                  * 判断当前网络是否可用                  */                 if (NetworkDetector.detect(indexContext))                 { ...
web.xml <!-- 指定spring的配置文件,默认从web根目录寻找配置文件,我们可以通过spring提供的classpath:前缀指定从类路径下寻找 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring-security.xml,/WEB-INF/application-common.xml</param-value> </context-param&g ...
<beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans         http: ...
RelativeLayout: (绝对布局) RelativeLayout 允许子元素指定他们相对于其它元素或父元素的位置(通过ID 指定)。因此,你可以以右对齐,或上下,或置于屏幕中央的形式来排列两个元素。元素按顺序排列,因此如果第一个元素在屏幕的中央,那么相对于这个元素的其它元素将以屏幕中央的相对位置来排列。如果使用XML 来指定这个 layout ,在你定义它之前,被关联的元素必须定义。  TableLayout: (相对布局) TableLayout 将子元素的位置分配到行或列中。一个TableLayout 由许多的TableRow 组成,每个TableRow 都会定义一个 ro ...
Android对用五大布局对象,它们分别是FrameLayout(框架布局),                                   LinearLayout (线性布局),                                   AbsoluteLayout(绝对布局),                                   RelativeLayout(相对布局),                                   TableLayout(表格布局). FrameLayout: (框架布局) FrameLayout是最简单的一个 ...
public class TalkServer { private static ServerSocket serverSocket; public static void main(String[] args) { connect(); } /* * 服务器连接 */ private static void connect() { try { serverSocket = new ServerSocket(9999); System.out.println("---服务器监听套接字中 ...
Global site tag (gtag.js) - Google Analytics