Thursday, April 25, 2013

[5-15]Google I/O Extended Guangzhou 2013I/O大会广州GDG直播之夜 报名

请移步

http://www.chinagdg.com/thread-1710-1-1.html

当晚我会出现,并且做技术分享。

GDL-Guangzhou Android Hour 线上直播活动

大家还记得GDL上每周三晚上的欧洲Android答疑Hangout吗?

也许大家对英文有些不适应,或者不知道如何跟外国人进行一次好的技术交流。
所以,也许大家心中有着很多Android开发中的疑惑,却苦于没有人去探讨,没有资深的Android开发者给予你们方向。

现在,这些烦恼再也不会有了!

GDG广州发起全国GDL活动,为广大Android开发者提供一个中文的技术交流平台!

GDL Guangzhou
由广州GDG发起的GDL Guangzhou,每隔一周的周三晚上8:30PM - 9:00PM,将会通过G+ Hangout进行实时交流,并且使用Youtube进行直播,录制后上传到Youku。
首次活动定于5月1日开始。
Hangout中将会探讨在汇问中的提问,和现场加入Hangout的各位朋友的提问。欢迎加入交流!

现召集首次活动,具体如下:

活动时间:5月1日(周三)晚上8:00PM - 9:00PM
Hangout时间:5月1日(周三) 晚上 8:30PM - 9:00PM
活动现场:广州贝塔咖啡M层(夹层)
线上活动:使用G+ Hangout进行,并同时使用Youtube直播(on Air),和录制后上传到Youku!
活动网址:
https://sites.google.com/site/gdlguangzhou/

如不能访问(各种原因),请使用:
http://gdlgz.winkeywong.com:3000/

参与方式:

提问:
可以通过每次活动详细页面底部的“Google汇问”系统进行提问,也可以对别人的提问进行投票。
越受欢迎的问题将越置于前面,会更早进行探讨!
你也可以通过G+ Hangout现场提问,或者在活动现场进行提问!

现场参加:
由于贝塔咖啡M层场地有限,在活动开始时,欢迎各位到现场进行Android的交流和围观!但是当直播开始时,我们要优先考虑录制现场嘉宾的位置和摄像的效果,也许需要各位在录制区域外围观。
但是我们绝对欢迎大家来围观!

线上参加:
无法到达现场的朋友,或者外地,甚至外国的朋友,你们可以通过G+ Hangout参加到我们的互动中,在直播开始之后,我们会在活动网页上放置加入Hangout的按钮,只要点击就能加入到我们当中来!
(请预先安装好G+ Hangout的Chrome插件,可以跟朋友先Hangout一次玩玩G+ Hangout的各种有趣功能哦)

同时,请留意我们的G+活动报名帖:
https://plus.google.com/events/c812mbn57ga2b1ihba8cm9ktscg

我们刚刚开始,但是我们不止步于此。Android Hours是第一步,以后将会有更多更多的其他Google技术的探讨活动!

各位开发者,我们在Hangout中等着你们!

Sunday, April 7, 2013

Android Query试用简记

最近一直在试用Android Query,已经比较上手了。

Android Query是一个类似JavaScript的JQuery的Android版本的东西,又称AQuery。它主要目的在于对Android开发的代码进行进一步的封装,简化开发者的开发流程,让开发更快。

他们的官网是:
https://code.google.com/p/android-query/

AQuery花了很大时间在图片处理和网络API调用方面,所以他们的官方介绍都是针对这方面来写,导致很多开发者觉得自己用不上,就没关注。

其实AQuery在无形中也简化了一些很普通的开发过程,以下就是获取各种View的例子。
在传统的Android开发过程中,获取一个TextView,一个Button和一个ImageView的代码如下:

而如果试用AQuery,则会变成这样:

乍看之下好像代码还多了一行,但是减少了一次强制转换的括号之后,代码变得更加易懂了。

而类似
aq.id(R.id.btn).text("Button").background(R.drawable.xxx);
这种链式的jquery常见方式,在代码中的应用让开发和阅读更加简单方便。

在AQuery中,很多时候不需要管View的类型而直接进行操作,还可以使用链式,当AQuery没有提供到View的某个功能时,可以直接用getImageView这种方式获得对应类型的View再进行特别的操作,可见AQuery的自由度是很高的。

AQuery目前还处于beta版本,最新是0.25.6版。个人觉得是一个不错的Android Library。

当然,使用AQuery将会让你的项目增加204KB的apk大小,这点请谨慎考虑。本人之前给客户开发的一个楼盘App总共才600多kb,其中AQ就占了204kb,当然在解决图片获取和缓存,内存处理的情况下,这个增加是很值得的。

推荐给大家。

Android topic sharing in Chinese(Android主题中文分享)

最近努力向中国Android开发者分享开发技术,于是接下来会有越来越多的中文主题发布。

Wednesday, July 11, 2012

How to enable Nexus Q out of US

Google I/O 2012 has been closed for half month, and I think a lot of people already took their Nexus Q and Nexus 7 with Android 4.1 back to their country.

Here comes the problem, Google Nexus Q is only available in few countries.

Today I got a set of Nexus Q and Nexus 7 from Anson my friend, and he can't make it working in China here. He hope me find out a solution.

OK, here's the Nexus Q and Nexus 7 photos.






Nexus 7 is pretty good, and Android 4.1 is awsome.

Now lets start.

Tools and services that are required:
1. Macbook Pro or one more unused wifi router.
2. an VPN account which server stay in US.

How to by using Macbook Pro:

1. plug in Ethernet cable into your Macbook pro and connect to internet with it.
2. set up VPN in Network setting. (Don't use openVPN client) Connect it.
    Be sure that you have already tick "transfer all data via VPN" selection.
3. Go to sharing setting in your mac.
4. Turn on Internet sharing, choose the vpn you just connected as "From" and choose "WIFI" as "to".

Now you have a fully proxy WIFI AP. Connect your Nexus 7 to this WIFI.

Power on your Nexus Q. Turn on NFC on your Nexus 7. Do the NFC connect by putting your Nexus 7 on top of your Nexus Q.

After the notification sound, Nexus 7 automatically go to Google Play. And you should see Nexus Q app can be install on our Nexus 7 now.

Install it and open it, following the setup guid to set up your Nexus Q.

Finally, Have Fun!!!!

Be care, in this way, both Nexus Q and Nexus 7 will use your Macbook Pro as WIFI AP. be sure don't close your WIFI internet sharing while you are using them.

How to by using WIFI router:

1. plug in Ethernet cable into WAN port on your router and connect it to upper router.
2. Go to router setting site. Change WAN port internet connection way to "PPTP" or "L2TP" (based on your VPN).
3. connect your router on VPN.
4. Config the WIFI signal as usual.

Now you have a fully proxy WIFI. Connect your Nexus 7 to this WIFI.

Power on your Nexus Q. Turn on NFC on your Nexus 7. Do the NFC connect by putting your Nexus 7 on top of your Nexus Q.

After the notification sound, Nexus 7 automatically go to Google Play. And you should see Nexus Q app can be install on our Nexus 7 now.

Install it and open it, following the setup guid to set up your Nexus Q.

Finally, Have Fun!!!!

This way, all data will be going through your WIFI router.








Trouble Shooting:
If you see LED changed to yellow on Nexus Q, means cannot connect to WIFI, check your wifi setting.


Monday, March 5, 2012

Androd AR engine learning daily (2): Starting with Mixare

I introduced Mixare to you in my last post. I'm trying to explain how it works in this post.

As I'm also a starter on this, so I'm inviting all the readers join and discuss about this.

I think most of the readers has watched the video from Mixare website, understood how it works, how it create the markers and display them on top of mountains. It's exciting me a bit, so I start on this now.

Let's starting with the sample code from Mixare. This is not only a sample code, but also a full engine src code about Mixare. You can copy it into any project if you wish. In order to do so, just pay attention on the  manifest xml file, you should add the correct permissions.

OK, here's the engine file tree:



Here are some important files:
1) MixView, this is the entry activity of the AR view, if you are going to integrate the AR engine into any existing project, please use startActivity(), giving this view as target. That's the only thing you have to do, simple!

2) DataView.java, this is the data layer (or markers layer) view. In this view, there's a function draw(), this function will be called quite a lot times per second. Yes, it likes a game engine. you can write any code inside draw() function in order to draw things on to the screen.

In draw() function, you can find the codes about how to draw the markers, and how to draw the rader. As below:



You can edit the code to filter the markers or change the marker drawable here. and also you can customize the radar.

3) DownloadManager.java, this is the class handling the data downloading and creating the markers. You can change the data source here, or you can custom add some manually markers here.

4) XMLHandler.java, this is called by Download Manager when using xml way. I delete this file because I'm using JDOM to read XML and add markers directly inside DownloadManager.

5) Markers.java and XXMarkers.java, these classes are the markers. Markers.java is the super class, has functions about how to draw markers, how to detect the click event, etc. XXMarkers are extend from Markers, you can draw spec markers based on project requirement. Take XXMarkers as example then you can create your own marker class extends from Marker.java.

Creating markers is a bit easy, you can use any existed marker class or you create one, call the construct function, telling the marker instance what its latitude, longitude, altitude should be, and the drawable images.

You can spec the height of the markers on screen if you wish. Just forget the altitude, and modify draw() function in side DataView.java. give a fixed 'y' value to marker.draw() function for each markers.

If you wish to added your custom layout on the screen, use Android's addContentView(), add it in MixView.onCreate(). Just pay attention on the flows, the view first added will be shown at bottom layer of the screen. Don't add content view before Camera View! Otherwise they will no been shown at all.

That's all about the starting, it's quite easy. You can try your own data now.

Next post, I will talk about how to spec the markers, and how to use the distance filter.

Thank you all.