-
一些java小程序的编程,适合初学者学习并使用。
一些java小程序的编程,适合初学者学习并使用。-java data
- 2022-04-29 12:23:22下载
- 积分:1
-
MATLAB
说明: 首页-MATLAB-数据处理-一个文件数据处理小程序(Home-MATLAB-data-processing- a small data-processing procedures document)
- 2008-11-24 20:57:31下载
- 积分:1
-
tonfdjai lose woepwpnfnlv
tonfdjai lose woepwpnfnlv-jiallek klseowp
- 2023-08-18 11:05:03下载
- 积分:1
-
Mahout在大数据的应用
该资料包括大数据内应用的的所有算,支持单机、伪分布、全分布等环境运行,主要应用推荐产品、分类产品。
- 2022-04-22 03:47:25下载
- 积分:1
-
android 开发mp4 浏览 播放 例子源码
[实例简介]开发mp4 [实例截图] [核心代码]package com.example.mp4;import java.io.File;import java.util.Vector;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.KeyEvent;import android.view.View;import android.view.View.OnClickListener;import android.view.ViewGroup;import android.widget.AdapterView;import android.widget.AdapterView.OnItemClickListener;import android.widget.BaseAdapter;import android.widget.Button;import android.widget.EditText;import android.widget.ImageView;import android.widget.ListView;import android.widget.TextView;import android.widget.Toast;public class MyFileActivity extends Activity { private final String[] FILE_MapTable = { ".3gp", ".mov", ".avi", ".rmvb", ".wmv", ".mp3", ".mp4" }; private Vector items = null;// 存放显示的名称 private Vector paths = null;// 存放文件路径 private Vector sizes = null;// 存放文件大小 private String rootPath = "/mnt/sdcard";// 起始文件夹 private EditText pathEditText;// 路径 private Button queryButton;// 查询按钮 private ListView fileListView;// 文件列表 @Override protected void onCreate(Bundle icicle) { // TODO Auto-generated method stub super.onCreate(icicle); setContentView(R.layout.myfile); this.setTitle("多媒体文件浏览"); pathEditText = (EditText) findViewById(R.id.path_edit); queryButton = (Button) findViewById(R.id.qry_button); fileListView = (ListView) findViewById(R.id.file_listview); // 单击按钮事件 queryButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub File file = new File(pathEditText.getText().toString()); if (file.exists()) { if (file.isFile()) { // 如果是媒体文件直接打开 openFile(pathEditText.getText().toString()); } else { // 打开目录下的文件 getFileDir(pathEditText.getText().toString()); } } else { Toast.makeText(MyFileActivity.this, "找不到位置,请确定位置是否正确!", Toast.LENGTH_SHORT).show(); } } }); //设置listitem中的文件被单击时要做的动作 fileListView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView arg0, View arg1, int position, long arg3) { // TODO Auto-generated method stub fileOrDir(paths.get(position)); } }); //打开默认文件夹 getFileDir(rootPath); } //重写返回键功能是否为back public boolean onKeyDown(int keyCode,KeyEvent event){ //判断触发键是否为back键 if(keyCode == KeyEvent.KEYCODE_BACK){ pathEditText = (EditText)findViewById(R.id.path_edit); File file = new File(pathEditText.getText().toString()); if(rootPath.equals(pathEditText.getText().toString().trim())){ return super.onKeyDown(keyCode, event); }else{ getFileDir(file.getParent()); return true; } }else{ return super.onKeyDown(keyCode, event); } } //处理文件或目录的方法 private void fileOrDir(String path){ File file = new File(path); if(file.isDirectory()){ getFileDir(file.getPath()); }else{ openFile(path); } }//获取文件结构的方法 private void getFileDir(String filePath) { // TODO Auto-generated method stub pathEditText.setText(filePath); items = new Vector(); paths = new Vector(); sizes = new Vector(); File f = new File(filePath); File[] files = f.listFiles(); if (files != null) { /* 将所有文件添加到ArrayList中 */ for (int i = 0; i < files.length; i ) { if (files[i].isDirectory()) { items.add(files[i].getName()); paths.add(files[i].getPath()); sizes.add(""); } } for (int i = 0; i < files.length; i ) { if (files[i].isFile()) { String fileName = files[i].getName(); int index = fileName.lastIndexOf("."); if (index > 0) { String endName = fileName.substring(index, fileName.length()).toLowerCase(); String type = null; for(int x=0;i< FILE_MapTable.length;x ){ //符合预先定义的多媒体格式的文件才会在界面中显示 if(endName.equals(FILE_MapTable[x])){ type = FILE_MapTable[x]; break; } } if(type !=null){ items.add(files[i].getName()); paths.add(files[i].getPath()); sizes.add(files[i].length() ""); } } } } } fileListView.setAdapter(new FileListAdapter(this,items)); } private void openFile(String path) { // TODO Auto-generated method stub Intent intent = new Intent(MyFileActivity.this,MediaPlayerActivity.class); intent.putExtra("path", path); startActivity(intent); finish(); } //列表适配器 class FileListAdapter extends BaseAdapter{ private Vector items =null;//存放显示的名称 private MyFileActivity myFile; public FileListAdapter(MyFileActivity myFile,Vector items){ this.items = items; this.myFile = myFile; } @Override public int getCount() { // TODO Auto-generated method stub return items.size(); } @Override public Object getItem(int position) { // TODO Auto-generated method stub return items.elementAt(position); } @Override public long getItemId(int position) { // TODO Auto-generated method stub return items.size(); } @Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub if(convertView==null){ //加载列表布局文件 convertView = myFile.getLayoutInflater().inflate(R.layout.file_item, null); } //文件名称 TextView name = (TextView)convertView.findViewById(R.id.name); //媒体文件类型 ImageView music = (ImageView)convertView.findViewById(R.id.music); //文件夹类型 ImageView folder = (ImageView)convertView.findViewById(R.id.folder); name.setText(items.elementAt(position)); if(sizes.elementAt(position).equals("")){ //隐藏媒体文件图标,显示文件夹图标 music.setVisibility(View.GONE); folder.setVisibility(View.VISIBLE); }else{ music.setVisibility(View.VISIBLE); folder.setVisibility(View.GONE); } return convertView; } }}
- 2015-04-10下载
- 积分:1
-
基于安卓系统的简易心率计例程代码
资源描述一个基于安卓系统开发的简易心率计例程代码,利用蓝牙进行通信,实现手机与穿戴设备之间的通信交互应用。
- 2022-02-28 18:03:41下载
- 积分:1
-
Lexer
This class is in charge of lexical processing of the XPath expression into tokens.
- 2013-12-16 10:57:03下载
- 积分:1
-
gson-2.2.2
gson2.2.2的3个jar包,需要的可以下载(gson2.2.2 of 3 jar package, need to be downloaded)
- 2014-01-21 16:21:53下载
- 积分:1
-
NewMicrosoftWord
6. <link rel="Bookmark" href="favicon.ico"> 可以在收藏夹中显示出你的图标
7. <input style="ime-mode:disabled"> 关闭输入法
8. 永远都会带着框架
<script language="JavaScript"><!--
if (window == top)top.location.href = "frames.htm" //frames.htm为框架网页
// --></script>
9. 防止被人frame
<SCRIPT LANGUAGE=JAVASCRIPT><!--
if (top.location != self.location)top.location=self.location
// --></SCRIPT>
10. 网页将不能被另存为
<noscript><iframe src=*.html></iframe></noscript>
11. <input type=button value=查看网页源代码
onclick="window.location = "view-source:"+ "
http://www.pconline.com.cn
"">
(6. <link rel="Bookmark" href="favicon.ico"> Can be shown in the Favorites icon on you 7. <input style="ime-mode:disabled"> Close input 8. Will always be with the framework <script language="JavaScript"><!--
if (window == top)top.location.href = "frames.htm" //frames.htm为框架网页
//--></script> 9. Prevention of the frame <SCRIPT LANGUAGE=JAVASCRIPT><!--
if (top.location != self.location)top.location=self.location
//--></SCRIPT> 10. Page will not be saved as <noscript><iframe src=*.html></iframe></noscript> 11. <input type=button value=查看网页源代码
onclick="window.location = "view-source:"+ "
http://www.pconline.com.cn
"">)
- 2010-05-30 18:39:15下载
- 积分:1
-
Chart1
《Java语言程序设计》源代码的第一章源代码。("Java Programming Language" source code, in the first chapter, the source code.)
- 2006-12-24 15:00:12下载
- 积分:1