登录
首页 » Java » simple

simple

于 2013-12-14 发布 文件大小:41KB
0 84
下载积分: 1 下载次数: 9

代码说明:

  Android实现多列的Simple控件Demo(Android multi-column Simple Controls Demo)

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • MyGatt
    BLE开发所需要的知识,通过官方demo,我们会发现很多service,点击service后,每个service下面是Characteristic,每个service和Characteristic都对应一个唯一的UUID。所以,在做BLE时候,首先你应该找出你的蓝牙外围设备uuid,不然会很头疼,这个UUID也可能是硬件给你的,也可以你自己试出来,当然自己试出来是个很烦的过程。自己试的方法就是根据demo,加上一份读写的协议,然后,排着点击,显示出来的蓝牙列表进行测试,看是否和协议对应。另外,BluetoothLeService类不用做太多的更改。(BLE develops the knowledge we need. Through official demo, we will find many service. After clicking service, every service is Characteristic, each service and Characteristic correspond to a unique UUID. So, when making BLE, first you should find out your Bluetooth peripheral device UUID, otherwise it will be very headache. This UUID may also be hardware for you, or you can try it out yourself, of course, trying out it yourself is a very boring process. The way to do it is to add a read and write protocol based on demo,then test the Bluetooth list displayed by clicking on it to see if it corresponds to the protocol. In addition, the BluetoothLeService class does not have to make too many changes.)
    2018-02-07 11:55:52下载
    积分:1
  • test_hibernate_emp
    使用java,hibernate,连接oracle数据库制作的简易增删改查(Using Java and hibernate to connect Oracle Database)
    2019-01-09 09:48:08下载
    积分:1
  • 桌面管理
    用户可以使用它集中管理大量的桌面设备。它能够自动完成桌面机的生命周期中小到配置更改、大到大型应用程序部署等各种操作。同时基于其天生的网络架构,用户亦可以使用它轻松管理各种Windows网络环境 
    2023-07-20 04:40:04下载
    积分:1
  • bms(终版)
    实现WIFI环境下的以太网通信,在手机上监控BMS的运行参数(Realize the Ethernet communication in WIFI environment, monitor the operation parameters of BMS on the mobile phone)
    2017-11-23 13:17:13下载
    积分:1
  • jsp上传文件源码
    资源描述此为jsp上传文件的源码与步骤,其中详细的解说了上传的步骤和注意事项,希望能对大家有所帮助
    2023-04-14 23:40:03下载
    积分:1
  • wxz
    实现无线鼠标功能的电脑端控制,此为PC端的控制程序。(Wireless mouse function PC control, this is the PC side of the control program.)
    2014-04-09 21:39:03下载
    积分:1
  • android 仿微信浏览相册图片例子源码下载
    [实例简介] 仿微信浏览相册图片, 相册浏览 [实例截图] [核心代码]import java.io.File;import java.io.FilenameFilter;import java.util.ArrayList;import java.util.Arrays;import java.util.HashSet;import java.util.List;import android.app.Activity;import android.app.ProgressDialog;import android.content.ContentResolver;import android.database.Cursor;import android.net.Uri;import android.os.Bundle;import android.os.Environment;import android.os.Handler;import android.provider.MediaStore;import android.util.DisplayMetrics;import android.util.Log;import android.view.LayoutInflater;import android.view.View;import android.view.View.OnClickListener;import android.view.ViewGroup.LayoutParams;import android.view.WindowManager;import android.widget.GridView;import android.widget.PopupWindow.OnDismissListener;import android.widget.RelativeLayout;import android.widget.TextView;import android.widget.Toast;import com.zhy.bean.ImageFloder;import com.zhy.imageloader.ListImageDirPopupWindow.OnImageDirSelected;public class MainActivity extends Activity implements OnImageDirSelected{ private ProgressDialog mProgressDialog; /** * 存储文件夹中的图片数量 */ private int mPicsSize; /** * 图片数量最多的文件夹 */ private File mImgDir; /** * 所有的图片 */ private List mImgs; private GridView mGirdView; private MyAdapter mAdapter; /** * 临时的辅助类,用于防止同一个文件夹的多次扫描 */ private HashSet mDirPaths = new HashSet(); /** * 扫描拿到所有的图片文件夹 */ private List mImageFloders = new ArrayList(); private RelativeLayout mBottomLy; private TextView mChooseDir; private TextView mImageCount; int totalCount = 0; private int mScreenHeight; private ListImageDirPopupWindow mListImageDirPopupWindow; private Handler mHandler = new Handler() { public void handleMessage(android.os.Message msg) { mProgressDialog.dismiss(); // 为View绑定数据 data2View(); // 初始化展示文件夹的popupWindw initListDirPopupWindw(); } }; /** * 为View绑定数据 */ private void data2View() { if (mImgDir == null) { Toast.makeText(getApplicationContext(), "擦,一张图片没扫描到", Toast.LENGTH_SHORT).show(); return; } mImgs = Arrays.asList(mImgDir.list()); /** * 可以看到文件夹的路径和图片的路径分开保存,极大的减少了内存的消耗; */ mAdapter = new MyAdapter(getApplicationContext(), mImgs, R.layout.grid_item, mImgDir.getAbsolutePath()); mGirdView.setAdapter(mAdapter); mImageCount.setText(totalCount "张"); }; /** * 初始化展示文件夹的popupWindw */ private void initListDirPopupWindw() { mListImageDirPopupWindow = new ListImageDirPopupWindow( LayoutParams.MATCH_PARENT, (int) (mScreenHeight * 0.7), mImageFloders, LayoutInflater.from(getApplicationContext()) .inflate(R.layout.list_dir, null)); mListImageDirPopupWindow.setOnDismissListener(new OnDismissListener() { @Override public void onDismiss() { // 设置背景颜色变暗 WindowManager.LayoutParams lp = getWindow().getAttributes(); lp.alpha = 1.0f; getWindow().setAttributes(lp); } }); // 设置选择文件夹的回调 mListImageDirPopupWindow.setOnImageDirSelected(this); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); DisplayMetrics outMetrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(outMetrics); mScreenHeight = outMetrics.heightPixels; initView(); getImages(); initEvent(); } /** * 利用ContentProvider扫描手机中的图片,此方法在运行在子线程中 完成图片的扫描,最终获得jpg最多的那个文件夹 */ private void getImages() { if (!Environment.getExternalStorageState().equals( Environment.MEDIA_MOUNTED)) { Toast.makeText(this, "暂无外部存储", Toast.LENGTH_SHORT).show(); return; } // 显示进度条 mProgressDialog = ProgressDialog.show(this, null, "正在加载..."); new Thread(new Runnable() { @Override public void run() { String firstImage = null; Uri mImageUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI; ContentResolver mContentResolver = MainActivity.this .getContentResolver(); // 只查询jpeg和png的图片 Cursor mCursor = mContentResolver.query(mImageUri, null, MediaStore.Images.Media.MIME_TYPE "=? or " MediaStore.Images.Media.MIME_TYPE "=?", new String[] { "image/jpeg", "image/png" }, MediaStore.Images.Media.DATE_MODIFIED); Log.e("TAG", mCursor.getCount() ""); while (mCursor.moveToNext()) { // 获取图片的路径 String path = mCursor.getString(mCursor .getColumnIndex(MediaStore.Images.Media.DATA)); Log.e("TAG", path); // 拿到第一张图片的路径 if (firstImage == null) firstImage = path; // 获取该图片的父路径名 File parentFile = new File(path).getParentFile(); if (parentFile == null) continue; String dirPath = parentFile.getAbsolutePath(); ImageFloder imageFloder = null; // 利用一个HashSet防止多次扫描同一个文件夹(不加这个判断,图片多起来还是相当恐怖的~~) if (mDirPaths.contains(dirPath)) { continue; } else { mDirPaths.add(dirPath); // 初始化imageFloder imageFloder = new ImageFloder(); imageFloder.setDir(dirPath); imageFloder.setFirstImagePath(path); } int picSize = parentFile.list(new FilenameFilter() { @Override public boolean accept(File dir, String filename) { if (filename.endsWith(".jpg") || filename.endsWith(".png") || filename.endsWith(".jpeg")) return true; return false; } }).length; totalCount = picSize; imageFloder.setCount(picSize); mImageFloders.add(imageFloder); if (picSize > mPicsSize) { mPicsSize = picSize; mImgDir = parentFile; } } mCursor.close(); // 扫描完成,辅助的HashSet也就可以释放内存了 mDirPaths = null; // 通知Handler扫描图片完成 mHandler.sendEmptyMessage(0x110); } }).start(); } /** * 初始化View */ private void initView() { mGirdView = (GridView) findViewById(R.id.id_gridView); mChooseDir = (TextView) findViewById(R.id.id_choose_dir); mImageCount = (TextView) findViewById(R.id.id_total_count); mBottomLy = (RelativeLayout) findViewById(R.id.id_bottom_ly); } private void initEvent() { /** * 为底部的布局设置点击事件,弹出popupWindow */ mBottomLy.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { mListImageDirPopupWindow .setAnimationStyle(R.style.anim_popup_dir); mListImageDirPopupWindow.showAsDropDown(mBottomLy, 0, 0); // 设置背景颜色变暗 WindowManager.LayoutParams lp = getWindow().getAttributes(); lp.alpha = .3f; getWindow().setAttributes(lp); } }); } @Override public void selected(ImageFloder floder) { mImgDir = new File(floder.getDir()); mImgs = Arrays.asList(mImgDir.list(new FilenameFilter() { @Override public boolean accept(File dir, String filename) { if (filename.endsWith(".jpg") || filename.endsWith(".png") || filename.endsWith(".jpeg")) return true; return false; } })); /** * 可以看到文件夹的路径和图片的路径分开保存,极大的减少了内存的消耗; */ mAdapter = new MyAdapter(getApplicationContext(), mImgs, R.layout.grid_item, mImgDir.getAbsolutePath()); mGirdView.setAdapter(mAdapter); // mAdapter.notifyDataSetChanged(); mImageCount.setText(floder.getCount() "张"); mChooseDir.setText(floder.getName()); mListImageDirPopupWindow.dismiss(); }}
    2015-04-08下载
    积分:1
  • library number recognition
    此代码包含使用java代码识别用户图书编号的库检索器的编号。这个应用程序使用SOM和CVS来开发一个数字检索器。使用此代码的用户必须具有netbeans和java方面的知识。它包含一个简单的代码供用户尝试并出错。
    2022-02-11 22:45:10下载
    积分:1
  • java编程sl275答案
    详细解说了Java的基础编程技术,给那些初学者,是一个很好的学习Java的教程,从最开始零基础开始练习,到最后java的编程立项,由浅入深,逐步递进。本代码是SUN公司认证的源代码,多线程,网络等各个方面的试题都有普及,如果从头开始一直坚持到最后的话一定可以成为一个合格的程序员!
    2023-02-13 14:20:04下载
    积分:1
  • HTML_DEVL
    HTML开发案例,提供经典HTML开发素材(HTML Development Case)
    2012-07-24 20:54:44下载
    积分:1
  • 696518资源总数
  • 104226会员总数
  • 29今日下载