Android圆形图片

看到最新版的QQ上,头像弄成圆形图片去了。圆形图片是当下很流行的一种图片展示方式,我很好奇的想了一下如何处理,无果之下搜了下,找到一个开源的圆形图片项目(CircleImageView)。除了这个项目以外其实还有很多更NB的项目,不仅可以做出圆形图片,还可以做出心形的,波浪环形的,XX形的……不要在意这些细节,现在来看下,如何做出圆形图片。
继续阅读

Android onInterceptTouchEvent和onTouchEvent小谈

个人觉得,做Android开发的话,Android的touch事件的处理的应用方法是应该要掌握的,其中onInterceptTouchEvent和onTouchEvent就是需要学习的非常重要的内容,非常多的特殊效果都需要用到这两个法才能实现,比如说support v4包中的ViewPager。当年还没有v4包的时,就在Android代码里面翻到过Laucher的一段代码,文件名似乎是Workspace.java,其实就是ViewPager的较弱版本,不会按需加载子view,但是这个效果却是非常惹眼的。其实之前,我一直对这两个玩意儿模模糊糊的,又没有做到相关内容,去把它们研究得仔细,最近的一个工作,才让我把这两个onXXX搞得比较清楚了些。
继续阅读

CoolReader源码中判断Android设备是否有物理Menu键

在Android4.0以后,有API可以判断是否有物理的Menu键,而SDK小于14的呢?
下面代码就是从CoolReader里取出来的,判断Android设备是否有物理Menu键~~~~~
这里可以看到,CR认为4.0以下的设备,E-ink屏幕的都没有物理Menu键的,其他的都认为有~~~~~~
还真是简略吖~~~~~~~
继续阅读

检查android联网方法

下面代码可以检查android是否接入网络,但可能没有Internet访问

public boolean isConnectingToInternet() {
    ConnectivityManager connectivity =
        (ConnectivityManager) context.getSystemService(
            Context.CONNECTIVITY_SERVICE);
    if (connectivity != null) {
        NetworkInfo[] info = connectivity.getAllNetworkInfo();
        if (info != null)
            for (NetworkInfo i : info)
                if (i.getState() ==
                       NetworkInfo.State.CONNECTED) {
                     return true;
                }
    }
    return false;
}

注意INTERNET和ACCESS_NETWORK_STATE权限
配合网络状态改变广播(Filter的action是ConnectivityManager.CONNECTIVITY_ACTION)来侦测是否接入网络,我在测试时,锁屏后解锁,是会收到这个广播的

桌面大战UI设计

桌面大战UI设计

2012年10月,Juwend等为三星Note手机平台做了一个Android手机游戏,分辨率为1280*800的Android设备均可以使用,名字叫《桌面大战Desktop fighting》。程序由Juwends负责的,UI设计由我负责的。上图可以看出,我的水平一般般…还没有滚进设计艺术圈,千万不要叫我滚出去~~

android-dip

状态

Android中dp和dip是一个意思(也许是一个意思)
无论(分辨率大小, 屏幕大小) -> (dpi),即每英寸点数有多少
使用相同dp(dip)表述的大小在屏幕上显示的大小理论上是相同的

转~Android OpenGL ES 2.0 (六)之 Responding to Touch Events

Making objects move according to a preset program like the rotating triangle is useful for getting some attention, but what if you want to have users interact with your OpenGL ES graphics? The key to making your OpenGL ES application touch interactive is expanding your implementation of GLSurfaceView to override the onTouchEvent() to listen for touch events.

继续阅读

转~Android OpenGL ES 2.0 (五)之 Adding Motion

Drawing objects on screen is a pretty basic feature of OpenGL, but you can do this with other Android graphics framwork classes, including Canvas and Drawable objects. OpenGL ES provides additional capabilities for moving and transforming drawn objects in three dimensions or in other unique ways to create compelling user experiences.

继续阅读

转~Android OpenGL ES 2.0 (四)之 Applying Projection and Camera Views

In the OpenGL ES environment, projection and camera views allow you to display drawn objects in a way that more closely resembles how you see physical objects with your eyes. This simulation of physical viewing is done with mathematical transformations of drawn object coordinates:

继续阅读

转~Android OpenGL ES 2.0 (一)之 Building an OpenGL ES Environment

In order to draw graphics with OpenGL ES in your Android application, you must create a view container for them. One of the more straight-forward ways to do this is to implement both a GLSurfaceView and a GLSurfaceView.Renderer. A GLSurfaceView is a view container for graphics drawn with OpenGL and GLSurfaceView.Renderer controls what is drawn within that view. For more information about these classes, see the OpenGL ES developer guide.

继续阅读

Using the NDK plugin

Using the NDK plugin
posted Jul 2, 2012, 7:16 PM by Siva Velusamy

ADT 20 includes an NDK plugin that provides support for building and debugging NDK projects in Eclipse. This document describes how to install and use the NDK plugin.

Installation
The NDK plugin currently works with CDT 7.0.2 or CDT 8.0.2.
  1. Download Eclipse for Java.
  2. Install CDT from Eclipse update site http://download.eclipse.org/tools/cdt/releases/indigo.
  3. Install Android SDK + NDK Plugins from Eclipse update site https://dl-ssl.google.com/android/eclipse/
  • 页数 1 / 2
  • 1
  • 2
  • >