Tuesday, January 26, 2010

Pre-announce NubiNews.net

NubiNews.net is the next generation of NubiNews.

The ".net" here means we will support "Community Sources" -- anyone can publish "enhancement scripts" for displaying their favorite web sites in the streamlined NubiNews style. This is very similar to greasemonkey, which has a large number of scripts available from http://userscripts.org/. So hopefully instead of the 50 or so web sites that NubiNews 7.x used to support, we will soon see hundreds of web sites ....

Also, NubiNews.net will no longer bundle a large number of enhancement scripts. This will allow the NubiNews author concentrate on their favorite tasks, such as improving the offline reading capabilities.

Thursday, January 21, 2010

People wake up

Here's a response to the "NubiNews falls victim to political pressure" comments in Android Market.

Not everything is about politics. We stopped distributing HK/Taiwan/US news because an HK publisher threatened to sue us. We have too little money and too little time to fight them in court.

Most non-mainland-China sites were already blocked by the Chinese firewall. There was no point for the Chinese government to take on NubiNews, as NubiNews does not have any firewall-breaking capability. Plus, NubiNews developers all live outside of China so we don't really care what the Chinese government thinks.

So here it goes. If you need to find someone to hate in this incident, pick the lawyers.

It's time to stop being too simple, sometimes naive.

P.S., we are working on a solution to separate (a) NubiNews the reader app, and (b) the contents. This will allow 3rd party developers to post their favorite sites onto NubiNews. Hopefully this will be done in a few weeks. In the mean time, please be patient and feel free to explore other wonderful readers out there :-)

Sunday, January 17, 2010

关于繁体与英语网站

其实这件事跟ZF的某些政策完全无关,而是版权的问题:

大牛新闻本身并没有任何服务器,所有内容都是直接从新闻网站下载到用户的手机,然后通过手机本地的JavaScript把HTML简化再显示。这种做法跟桌面电脑常用的GreaseMonkey是同一原理。

我们相信大牛新闻这种做法完全没有违反中国内地的任何法规,因为大牛新闻提供的只是JavaScript,而没有提供或转载任何新闻的内容。

可是我们对境外的法规不了解,并在最近遭到一些境外新闻供应商的干扰,在有充分法律意见之前,一切在版权方面有疑问的网站一律取消提供JavaScript。很不幸所有的繁体与英语网站都在此列。(还有一个简体的受害者是Engadget)

问题就是如此,希望大家不要对号入座,与最近发生的乱七八糟事件做过多的联想。

如有xd能提供境外法律援助(含港台美),请发mail到nubinews@gmail.com。谢谢!

Wednesday, January 6, 2010

Help us diagnose problems

If you see a weird problem with NubiNews, you can help us diagnose the problem by sending us the "Log File".

  • Install an application called SendLog from the Android Market.
  • Start NubiNews. Proceed until your problem occurs.
  • Go back to the Home Screem and launch SendLog.
  • Tap on the "Send" button
  • Choose e-mail address nubinews@gmail.com

Thanks!

中文:可以在Android Market安装一个叫SendLog的程序,然后跑大牛新闻,问题出现之后启动SendLog,点“Send”,发送到我们的邮箱 nubinews@gmail.com

谢谢

Sunday, January 3, 2010

More todo items

For better organization, the bugs/feature/todo list is moved to the google.code web site:

http://code.google.com/p/nubi/issues/list

Please file or vote for your favorite bugs!

Monday, December 28, 2009

Yes, you can run JavaScript inside a Service

Contrary to what I heard from the android-developers group, you can actually create a WebView inside an Android Service, and use it to run JavaScript. JavaScript is needed by NubiNews in processing the HTML data downloaded from the news web sites.

This means, finally, I can implement offline syncing inside a Service. It will probably take a month from this point ....

In my test, this code is added to a Service's onCreate function:

Object o = new Object() {
public void trace(String s) {
System.out.println("JavaScript: " + s);
}
};

public void onCreate() {
WebView webView = new WebView(this);
WebSettings webSettings = webView.getSettings();
webSettings.setSavePassword(false);
webSettings.setSaveFormData(false);
webSettings.setJavaScriptEnabled(true);
webSettings.setSupportZoom(false);
webView.addJavascriptInterface(o, "backdoor");

webView.loadData("<" + "script language="\">window.backdoor.trace('I AM HERE');<" + "/script>", "text/html", "utf-8");

and, I see this "proof of life" output from logcat:

I/System.out(10440): JavaScript: I AM HERE

Sunday, November 15, 2009

Smooth full screen transition

I finally found out how to smoothly transition to and from Android's full-screen mode. I wanted the status bar to be displayed most of the time, but switched off when the user views an image.

To create the main screen:

setContentView(mGLView);
addContentView(mTopView);

WindowManager.LayoutParams attrs = getWindow().getAttributes();
attrs.flags |= WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS;
getWindow().setAttributes(attrs);
mTopView.setPadding(0, 25, 0, 0);

mTopView is a FrameLayout at the top of my window hierarchy. 25 is the height of the status bar.

mGLView is a GLSurfaceView that I use to display the image. Note that at this point, the size of both mTopView and mGLView will fill the entire screen (but be clipped by the status bar at the top edge).

The setPadding() call offsets the child of mTopView so that the child appears just beneath the status bar.

To switch to full screen mode, call this

WindowManager.LayoutParams attrs = getWindow().getAttributes();
attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
getWindow().setAttributes(attrs);
change_my_layout();

The above code will essentially hide the status bar and give you an extra 25 pixels at the top of the screen. In change_my_layout(), I do this:

mTopView.setVisibility(View.GONE);
mGLView.setVisibility(View.VISIBLE);

The key here is to use FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_NO_LIMITS. Otherwise the screen will "jerk" a little bit when you apply FLAG_FULLSCREEN.

Also note that mGLView must be positioned behind mTopView in the view stack. Otherwise the mGLView will not be visible to the user EVEN IF the mTopView is set to View.GONE (due to interesting design in Android that's too much to explain here ....).

Failed Attempts:

I tried the "True Android Way" but creating a new full-screen Activity to hold the mGLView. However, this proved to be too slow (at least 500ms on the G1).