Android模仿发说说 完美版 无bug 可以本地获取相机,相册 删除,点击进入滑动 ui更新

先上效果:

上效果

现在直接贴代码,这个demo代码很少,2个activity之间的回调跳转时必须的,图中的小图标怎么找了,这个是最直接的功能,希望能帮助到和我一样的小白:

property_repair.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@+id/container"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="#ffffff"
  tools:ignore="MergeRootFrame" >

      <Button
          android:id="@+id/button1"
          android:layout_width="100dp"
          android:layout_height="30dp"
          android:text="提交问题"
          android:gravity="center"
      android:textColor="#1Eb2ff"
          android:background="@null"
          android:textSize="16sp"
		android:layout_alignParentRight="true"
          />

  <RelativeLayout
    android:id="@+id/Content_Layout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_below="@id/button1"
    android:gravity="center">
    <LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"
      android:background="#ffffff"
      android:layout_alignParentBottom="true" > 

      <EditText
        android:id="@+id/editText1"
        android:layout_height="120dp"
        android:layout_width="fill_parent"
        android:textColor="#1eb2ff"
        android:gravity="top"
        android:textSize="15sp"
        android:hint="请说明你的问题..."
        android:maxLength="500"
        android:singleLine="false"
        android:background="#ffffff"
     />
      <GridView
          android:id="@+id/Scrollgridview"
          android:layout_width="fill_parent"
          android:layout_height="180dp"
          android:layout_marginLeft="28dp"
          android:columnWidth="90dp"
          android:gravity="center"
          android:background="#ffffff"
          android:horizontalSpacing="5dp"
          android:listSelector="@android:color/transparent"
          android:numColumns="3"
          android:scrollbars="none"
          android:stretchMode="columnWidth"
          android:verticalSpacing="10dp" />

    </LinearLayout>
  </RelativeLayout>

</RelativeLayout>

activity_photo.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/LinearLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <LinearLayout
        android:id="@+id/linear_layout_fanhui"
        android:layout_width="match_parent"
        android:layout_marginTop="20dp"
        android:layout_height="23dp"

        >

	    <Button
	        android:id="@+id/fanhui"
	        android:layout_width="20dp"
	        android:layout_marginLeft="30dp"
	        android:layout_height="match_parent"
	   		android:layout_gravity="center_vertical"
	        android:background="@drawable/back"
	        android:paddingLeft="5dp"
	        android:textSize="15sp" />
    </LinearLayout>

    <android.support.v4.view.ViewPager
        android:id="@+id/viewpager"
        android:layout_width="match_parent"
        android:layout_height="500dp" >
    </android.support.v4.view.ViewPager>

    <Button
        android:id="@+id/deldete"
	android:layout_width="wrap_content"
	android:layout_height="match_parent"
 	android:layout_gravity="center_horizontal"
 android:background="@drawable/delet"
        />

</LinearLayout>

activity_selectimg.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#ffffff"
    android:orientation="vertical" >

                <HorizontalScrollView
                    android:id="@+id/selectimg_horizontalScrollView"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:paddingLeft="10dp"
                    android:paddingRight="10dp" >

                    <LinearLayout
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"
                        android:orientation="horizontal" >

                        <GridView
                            android:id="@+id/noScrollgridview"
                            android:layout_width="fill_parent"
                            android:layout_height="fill_parent"
                            android:fastScrollEnabled="true"
                            android:focusable="true"
                            android:gravity="center"
                            android:horizontalSpacing="0dp"
                            android:scrollbars="none"
                            android:scrollingCache="false"
                            android:stretchMode="spacingWidthUniform"
                            android:verticalSpacing="1dp" >
                        </GridView>
                    </LinearLayout>
                </HorizontalScrollView>

</LinearLayout>

item_popupwindows.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <LinearLayout
        android:id="@+id/ll_popup"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:background="#ffffff"
        android:orientation="vertical" >

        <TextView
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="#ff495a" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="55dp"
            android:orientation="horizontal" >

            <Button
                android:id="@+id/item_popupwindows_camera"
                android:layout_width="match_parent"
                android:layout_height="55dp"
                android:background="@drawable/bt_nobgd_top_button_left_right_11"
                android:text="拍照"
                android:textColor="#585858"
                android:textSize="18sp" />
        </LinearLayout>

        <TextView
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:layout_marginLeft="80dp"
            android:background="#f2f2f2" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="55dp"
            android:orientation="horizontal" >

            <Button
                android:id="@+id/item_popupwindows_Photo"
                android:layout_width="match_parent"
                android:layout_height="55dp"
                android:background="@drawable/bt_nobgd_top_button_left_right_11"
                android:text="从相册中选取"
                android:textColor="#585858"
                android:textSize="18sp" />
        </LinearLayout>

        <TextView
            android:layout_width="match_parent"
            android:layout_height="2dp"
            android:background="#f3f3f3" />

        <Button
            android:id="@+id/item_popupwindows_cancel"
            android:layout_width="match_parent"
            android:layout_height="55dp"
            android:background="@drawable/bt_nobgd_top_button_left_right_11"
            android:text="取消"
            android:textColor="#585858"
            android:textSize="18sp" />
    </LinearLayout>

</RelativeLayout>

item_published_grida.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

        <ImageView
            android:id="@+id/item_grida_image"
            android:layout_width="80dp"
            android:layout_height="80dp"
                 android:scaleType="fitXY"
             />

</RelativeLayout>

当然权限是少不了的:

     <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <uses-feature android:name="android.hardware.camera" />
    <uses-feature android:name="android.hardware.camera.autofocus" />

下面是程序:

PhotoActivity.java

package com.dynamic;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.ImageView;

public class PhotoActivity extends Activity {
	public  List<Bitmap> bitmap = new ArrayList<Bitmap>();
	private ArrayList<View> listViews ;
	private ViewPager pager;
	private MyPageAdapter adapter;
	private Button fanhui;
	private Button deldete;
	private int index = 0;
	private MainActivity property_repair;

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
			setContentView(R.layout.activity_photo);
				deldete=(Button) findViewById(R.id. deldete);
			/**
			 * 删除照片
			 */
			deldete.setOnClickListener(new OnClickListener() {

				@Override
				public void onClick(View v) {

					if (listViews.size() > 0) {
						listViews.remove(index);
						MainActivity.bmp.remove(index);
						adapter.notifyDataSetChanged();
	                	}
			}
		});

			fanhui=(Button) findViewById(R.id.fanhui);
			fanhui.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				finish();
			}
		});
		pager = (ViewPager) findViewById(R.id.viewpager);
		pager.setOnPageChangeListener(pageChangeListener);

		for (int i = 0; i < property_repair.bmp.size(); i++) {
			initListViews(property_repair.bmp.get(i));
		}
		adapter = new MyPageAdapter(listViews);// 构造adapter
		pager.setAdapter(adapter); //设置适配器
		Intent intent = getIntent();
		int id = intent.getIntExtra("ID", 0);
		pager.setCurrentItem(id);
	}

	private void initListViews(Bitmap bm) {

		if (listViews == null)
			listViews = new ArrayList<View>();
		final ImageView img = new ImageView(this);// 构造textView对象

		img.setImageBitmap(bm);
		img.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));

		// 添加view
		listViews.add(img);

	}

	private OnPageChangeListener pageChangeListener = new OnPageChangeListener() {

		public void onPageSelected(int arg0) {
			// 页面选择响应函数
				index = arg0;
		}

		public void onPageScrolled(int arg0, float arg1, int arg2) {// 滑动中。。。

		}

		public void onPageScrollStateChanged(int arg0) {// 滑动状态改变

		}
	};

	class MyPageAdapter extends PagerAdapter {

		private ArrayList<View> listViews;// content

		private int size;// 页数

		public MyPageAdapter(ArrayList<View> listViews) {// 构造函数
															// 初始化viewpager的时候给的一个页面
			this.listViews = listViews;
			size = listViews == null ? 0 : listViews.size();
		}

		public void setListViews(ArrayList<View> listViews) {// 自己写的一个方法用来添加数据
			this.listViews = listViews;
			size = listViews == null ? 0 : listViews.size();
		}

		public int getCount() {// 返回数量
	         if (listViews != null && listViews.size() > 0) {
	                return listViews.size();
	            } else {
	                return 0;
	            }
		}

		public int getItemPosition(Object object) {
			return POSITION_NONE;
		}

	    public void destroyItem(ViewGroup container, int position, Object object) {
            container.removeView((View) object);
            if(listViews.size()==0){

            	finish();
            }
        }  

		public void finishUpdate(View arg0) {
		}

        public Object instantiateItem(ViewGroup container, int position) {
            container.addView(listViews.get(position));
            return listViews.get(position);
        }  

		public boolean isViewFromObject(View arg0, Object arg1) {
			return arg0 == arg1;
		}

	}

}

MainActivity.java

package com.dynamic;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.WindowManager.LayoutParams;
import android.view.inputmethod.InputMethodManager;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.Toast;

public class MainActivity extends Activity implements OnItemClickListener {

	private GridView gridview;
	private GridAdapter adapter;
	private float dp;
	public  static List<Bitmap> bmp = new ArrayList<Bitmap>();
	public  static List<String> drr = new ArrayList<String>();
	private 	LinearLayout ll_popup ;
	private Button button1;// 发布按钮

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.property_repair);
		Init();

		final EditText editText1 = (EditText) findViewById(R.id.editText1);
		button1 = (Button) findViewById(R.id.button1);
		button1.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				if (editText1.getText().toString().length() == 0) {
					Toast.makeText(MainActivity.this, "请简述详情",
							Toast.LENGTH_SHORT).show();
				} else
				{
					Toast.makeText(MainActivity.this, "提交成功",Toast.LENGTH_SHORT).show();
									finish();
				}
			}
		});
	}
	List<String> urList = new ArrayList<String>();
		public void Init() {
			dp = getResources().getDimension(R.dimen.dp);
			gridview = (GridView) findViewById(R.id.Scrollgridview);
			gridviewInit();
		}

	public void gridviewInit() {

				adapter = new GridAdapter(this,bmp);
				adapter.setSelectedPosition(0);
				gridview.setAdapter(adapter);
				adapter.notifyDataSetChanged();
				gridview.setOnItemClickListener(this);

	}

		protected void onPause() {
			super.onPause();
		}

	private class GridAdapter extends BaseAdapter {
		private LayoutInflater listContainer;
		private int selectedPosition = -1;
		private   List<Bitmap> bmps=new ArrayList<Bitmap>();
		private class ViewHolder {
			public ImageView image;
		}
		private GridAdapter(Context context, List<Bitmap> bmp) {
			listContainer = LayoutInflater.from(context);
			bmps=bmp;
		}

		public int getCount() {
			return bmps.size() + 1;
		}

		public Object getItem(int arg0) {
			return null;
		}
		public long getItemId(int arg0) {
			return 0;
		}
		public void setSelectedPosition(int position) {
			selectedPosition = position;
		}
		public int getSelectedPosition() {
			return selectedPosition;
		}
		public View getView(int position, View convertView, ViewGroup parent) {
			final int sign = position;
			ViewHolder holder = null;
			if (convertView == null) {
				holder = new ViewHolder();
				convertView = listContainer.inflate(
						R.layout.item_published_grida, null);
				holder.image = (ImageView) convertView
						.findViewById(R.id.item_grida_image);

				convertView.setTag(holder);
			} else {
				holder = (ViewHolder) convertView.getTag();
			}

			if (position == bmps.size()) {
				holder.image.setImageBitmap(BitmapFactory.decodeResource(
						getResources(), R.drawable.icon_addpic_unfocused));
				if (position == 6) {
					holder.image.setVisibility(View.GONE);
				}
			} else {
				holder.image.setImageBitmap(bmps.get(position));
			}
			return convertView;
		}
	}
	private class PopupWindows extends PopupWindow {

		private PopupWindows(Context mContext, View parent) {

			View view = View.inflate(mContext, R.layout.item_popupwindows, null);
			ll_popup = (LinearLayout) view.findViewById(R.id.ll_popup);
			setWidth(LayoutParams.FILL_PARENT);
			setHeight(LayoutParams.FILL_PARENT);
			setFocusable(true);
			setOutsideTouchable(true);
			setContentView(view);
			showAtLocation(parent, Gravity.BOTTOM, 0, 0);
			update();

			Button bt1 = (Button) view.findViewById(R.id.item_popupwindows_camera);
			Button bt2 = (Button) view.findViewById(R.id.item_popupwindows_Photo);

			Button bt3 = (Button) view.findViewById(R.id.item_popupwindows_cancel);

			bt1.setOnClickListener(new OnClickListener() {
				public void onClick(View v) {
					photo();
					dismiss();
				}
			});
			bt2.setOnClickListener(new OnClickListener() {
				public void onClick(View v) {
					Intent i = new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
						startActivityForResult(i, RESULT_LOAD_IMAGE);
							dismiss();
				}
			});

			bt3.setOnClickListener(new OnClickListener() {
				public void onClick(View v) {
						dismiss();
				}
			});
		}
	}
	private static final int TAKE_PICTURE = 0;
	private static final int RESULT_LOAD_IMAGE = 1;
	private static final int UI=2;
	private String path = "";
	private Uri mOutPutFileUri;
	String picturePath;
	private void photo() {

		  Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
		  //文件夹aaaa
		  String path = Environment.getExternalStorageDirectory().toString()+"/elife/img";
		  File path1 = new File(path);
		  if(!path1.exists()){
		   path1.mkdirs();
		  }
		  File file = new File(path1,System.currentTimeMillis()+".jpg");
		  mOutPutFileUri = Uri.fromFile(file);
		  picturePath=file.getAbsolutePath();
		  intent.putExtra(MediaStore.EXTRA_OUTPUT, mOutPutFileUri);
		  startActivityForResult(intent, TAKE_PICTURE);
	}
	private void photoview()
	{
				Intent pc=new Intent(Intent.ACTION_PICK,android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
				startActivityForResult(pc, RESULT_LOAD_IMAGE);
	}
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
		switch (requestCode) {
		// 拍照
		case TAKE_PICTURE:
			if (resultCode==RESULT_OK) {
				startPhotoZoom(picturePath);
			}

			break;
		// 相册
		case RESULT_LOAD_IMAGE:
			if (resultCode==RESULT_OK) {

				Uri uri=data.getData();
				String[] files={MediaStore.Images.Media.DATA};
				Cursor c=this.getContentResolver().query(uri, files, null, null, null);
				c.moveToFirst();
				int ii=c.getColumnIndex(files[0]);
				path=c.getString(ii);
				c.close();
				startPhotoZoom(path);

			}

			break;

		}
	}
	private Bitmap getLoacalBitmap(String url) {
		try {
			FileInputStream fis = new FileInputStream(url);
			return BitmapFactory.decodeStream(fis); // /把流转化为Bitmap图片

		} catch (FileNotFoundException e) {
			e.printStackTrace();
			return null;
		}
	}
	private  Bitmap createFramedPhoto(int x, int y, Bitmap image, float outerRadiusRat) {
		Drawable imageDrawable = new BitmapDrawable(image);
		Bitmap output = Bitmap.createBitmap(x, y, Bitmap.Config.ARGB_8888);
		Canvas canvas = new Canvas(output);
		RectF outerRect = new RectF(0, 0, x, y);
		Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
		paint.setColor(Color.RED);
		canvas.drawRoundRect(outerRect, outerRadiusRat, outerRadiusRat, paint);
//		paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
		imageDrawable.setBounds(0, 0, x, y);
		canvas.saveLayer(outerRect, paint, Canvas.ALL_SAVE_FLAG);
		imageDrawable.draw(canvas);
		canvas.restore();

		return output;
	}
	private void startPhotoZoom(String uri) {
			drr.add(uri);
			Bitmap bitmap =getLoacalBitmap(drr.get(drr.size()-1 ));
					bmp.add(bitmap);
					gridviewInit();

	}
		protected void onDestroy() {
					bmp.clear();
					drr.clear();
				super.onDestroy();
	}

		@Override
		public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
			((InputMethodManager) getSystemService(INPUT_METHOD_SERVICE)).

			hideSoftInputFromWindow(MainActivity.this.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);

			if (arg2 == bmp.size()) {
			String sdcardState = Environment.getExternalStorageState();
			if (Environment.MEDIA_MOUNTED.equals(sdcardState)) {
				if(bmp.size()<5){
				new PopupWindows(MainActivity.this, gridview);
				}
				else{
					Toast.makeText(getApplicationContext(), "一次只能传5张", Toast.LENGTH_LONG).show();
				}
			} 

			else {
				Toast.makeText(getApplicationContext(), "sdcard已拔出,不能选择照片",	Toast.LENGTH_SHORT).show();
			}
		} 

			else
			{
				Intent intent = new Intent(MainActivity.this,PhotoActivity.class);
				intent.putExtra("ID", arg2);
				startActivity(intent);
			}

	}
		@Override
		protected void onResume()
		{
			adapter.notifyDataSetChanged();
				super.onResume();
		}

}

好了 以上是整个项目的程序  大家拷贝下来就可以运行了,祝各位程序小白更上一层楼

时间: 2024-07-30 13:16:15

Android模仿发说说 完美版 无bug 可以本地获取相机,相册 删除,点击进入滑动 ui更新的相关文章

Android 模仿发说说

本片博客的事例是根据我自己项目中的部分需求来的,所以有些和这个不相关的内容和源码,大家可以忽略不计.这种发说说的功能,我也是折腾了很久,今日才得知道,大神请不要见笑,,l里面的图片自己找好了,好了,先看效果: property_repair,xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.c

Android scrollview 上滑固定某一控件(美团团购详情UI)完美版

在scrollview 上滑固定某一控件(美团团购详情UI)文中介绍了怎么用touchlistener实现类似上滑停住的效果,但是这种方法存在一个明显的bug,就是在内容比较多的时候, 大部分人都是以滑动方式查看内容,而不是touch的方式,这就会导致最上面的滑块出现不及时,或者延后的现象,这里介绍一个全新的方法去实现类似效果,可以很好的解决以上问题. 目前在scrollview中没有onscrolllistener所以需要自己去实现,先复写一个scrollview: package com.e

【资源】Android学习资料 - 逆天整理 - 精华无密版

 入门看视频,提高看书籍,飘升做项目.老练研开源,高手读外文,大牛讲低调~  极客学院安卓Android全套最新视频教程[17G全套视频+独家源码] http://pan.baidu.com/s/1kT5nSkn 链接: http://pan.baidu.com/s/1jGsyJ0y 密码: btbg 传智播客Java安卓方向就业班全套视频下载 http://pan.baidu.com/s/1eQq4YXG 链接: http://pan.baidu.com/s/1qWA3yyS 密码: p7qj

《pigcms v6.2最新完美至尊版无任何限制,小猪微信源码多用户微信营销服务平台系统》

<pigcms v6.2最新完美至尊版无任何限制,小猪微信源码多用户微信营销服务平台系统> 前两天分享了套小猪CMS(PigCms)多用户微信营销服务平台系统V6.1完美破解至尊版带微用户管理CRM+微信支付,还是不少童鞋反应出不少问题.今天再分享套小猪pigcms v6.2最新完美至尊版无任何限制,pigcms多用户微信营销服务平台系统,非常感谢我们网站一位童鞋提供了这套源码,现在源码我们正在检测中,主要检测源码的安全性或有没有木马后门什么的. 暂时放我们测试时候的几张截图出来 102套模板

android studio 添加有趣的注释模板 佛祖保佑无bug等

韩梦飞沙  韩亚飞  [email protected]  yue31313  han_meng_fei_sha 汉化包 百度云盘 下载地址:https://pan.baidu.com/s/1pLjwyeB 1.找到设置setting(Ctrl Alt S),下图,其实两个都是一样的 2.找到Editor中的Live Templates3.点击" ",点Templates group创建一个新的名字可以叫fozu4.当创建成功后点这创建的名字再次点击" "号,这次点

漫谈程序员系列:无BUG不生活

我决定谈一谈世界上最著名的虫子:BUG ! BUG 困扰了一代又代的程序员,不论是杰出的计算机科学家,还是像 Linus Torvalds(Linux内核创始人) .Bill Joy(传说三天写出BSD的前身,vi和csh的作者)等神一样的传说,抑或你我芸芸程序猿,都是 BUG 骚扰的对象. BUG 是绝对狂热的好战分子,具有永不停歇的战斗欲望,它潜伏在程序员的周围,一双小眼贼亮贼亮,在你百密一疏时出其不意一击奏效.而无论你是钢筋铁骨,还是羊脂玉体,只要被这只虫子袭击(看过<木乃伊>的话,对圣

Android新技术学习——阿里巴巴免Root无侵入AOP框架Dexposed

阿里巴巴无线事业部最近开源的Android平台下的无侵入运行期AOP框架Dexposed,该框架基于AOP思想,支持经典的AOP使用场景,可应用于日志记录,性能统计,安全控制,事务处理,异常处理等方面. 针对Android平台,Dexposed支持函数级别的在线热更新,例如对已经发布在应用市场上的宿主APK,当我们从crash统计平台上发现某个函数调用有bug,导致经常性crash,这时,可以在本地开发一个补丁APK,并发布到服务器中,宿主APK下载这个补丁APK并集成后,就可以很容易修复这个c

Android Studio 2.3 正式版新功能,你不来看看?!

2017.3.3 Google老大发布了Android Studio 2.3正式版. 在许多2.3beta版本的基础上修复了bug然后推出了正式版.提供了一些新特性,和对部分已有功能的修改完善. Build Instant Run Improvements and UI Changes 之前的版本,会默认勾选上Instant Run 选项,然后在控制面板上只有一个Run 和Debug按钮.编译器自动判断是否需要Instant Run.2.3.0正式版在控制面板上多出了一个Instant Run按

麦当劳优惠券客户端应用源码完美版

麦当劳优惠券客户端应用源码完美版,该源码比较完整的,基本实现了常用的点餐订餐的功能了,大家可以参考一下吧. 应用说明: 能省钱的必备软件,占用资源少,起码可装个备用. *可直接使用,不需要打印,非常方便* 选好你需要的套餐,向柜台服务员展示即可 全国麦当劳通用.上海.广州.张家口.绵阳.青岛.深圳. 天津.北京.武.汕头.宝鸡.南京.呼和浩特.四川泸州.山西太原,以上城市已有热心网友验证可用电子券杭州.厦门麦当劳亲测可用 <ignore_js_op> 133302589.jpg (59.39