Skip to main content

Home/ Android Dev/ Group items tagged tip

Rss Feed Group items tagged

Vincent Tsao

[Tip][Google I/O 2011]Apply A/B testing to your Android App - 5 views

private static final boolean isA = UUID.randomUUID().getLeastSignificantBits() % 2 == 0; public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); if(isA){ setConte...

android tip

started by Vincent Tsao on 12 May 11 no follow-up yet
Kiran Kuppa

Using Ant to Automate Building Android Applications - 0 views

  •  
    Using the Eclipse GUI does not allow one to easily: (a) Add custom build steps (b) Use an automated build system (c) Use build configurations (d) Build the release project with one command.Fortunately, the Android SDK comes equipped with support for Ant.This tutorial will show you how to incorporate an Ant build script into your Android projects,even if you still develop with Eclipse.
Kiran Kuppa

How to Position Views Properly in Layouts | Think Android - 0 views

  •  
    "First off, the difference between android:gravity and android:layout_gravity is that android:gravity positions the contents of that view (i.e. what's inside the view), whereas android:layout_gravity positions the view with respect to its parent (i.e. what the view is contained in). "
Kiran Kuppa

Android Layout Tricks #3: Optimize by merging - 1 views

  •  
    The was created for the purpose of optimizing Android layouts by reducing the number of levels in view trees.When the LayoutInflater encounters this tag, it skips it and adds the children to the parent.You can also use when you create a custom composite view. 
Kiran Kuppa

Card UI - 0 views

  •  
    "Ever wondered about Google play store UI which is built around cards. Card is nothing but a single row item of ListView or GridView. As depicted below, card can be of various sizes and can be either app card, movie, books, games or app suggestions card or birthday card or even it can be a simple list/grid item too. The main benefit of designing app with card UI is it gives consistent looks throughout the application, doesn't matter whether it gets loaded in mobile or tablet."
Simon Pan

Tech Droid: Android WebView, Javascript and CSS - 5 views

  • Calling a Javascript method from your Java code: webView.loadUrl("javascript:jsToggle()"); Calling a Java method from Javascript: window.jsinterface.nativeToggle(); /*   // Before using the above code, you have to inject the interface object which   // has a name "jsinterface"   webView.addJavascriptInterface(jsInterface, "jsinterface"); */
    • Vincent Tsao
       
      useful tips
    • Simon Pan
       
      Is it use to auto-fill the form on WebView?
    • Vincent Tsao
       
      JSInterface lets you bind Java objects into the WebView so they can be controlled from the web pages JavaScript, which means we can do anything to the content from webview via javascript interface, like what we can do with the html DOM content with javascrpit
    • Simon Pan
       
      So, Can I retain username and password by this manner?
    • Vincent Tsao
       
      i think so, you can fill form field with jsinterface
    • Simon Pan
       
      thank you...go on together
Vincent Tsao

Set Screen Orientation Manully - 0 views

setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE)

android orientation tip

started by Vincent Tsao on 04 Nov 10 no follow-up yet
Vincent Tsao

Help getting array from arrays.xml file (Android, Eclipse) - Stack Overflow - 0 views

  • I am just trying to display a list from an array that I have in my arrays.xml.
  • String[] testArray = getResources().getStringArray(R.array.testArray); /** Called when the activity is first created. */ @Override protected void onCreate(Bundle savedInstanceState)
  • You can't initialize your testArray field this way, because the application resources still aren't ready.
  • ...1 more annotation...
  • protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    // Create an ArrayAdapter that will contain all list items    ArrayAdapter<String> adapter;    mTestArray =  = getResources().getStringArray(R.array.testArray);        /* Assign the name array to that adapter and     also choose a simple layout for the list items */     adapter = new ArrayAdapter<String>(    this,    android.R.layout.simple_list_item_1,    mTestArray);    // Assign the adapter to this ListActivity    setListAdapter(adapter);    }}
Vincent Tsao

一个发布应用需要注意的地方 - China Android Dev | Google Groups - 0 views

  • 我今天说的,无关于功能,也无关于布局,而在于资源命名。 我是这样发现问题的,我的应用《千字文》发布两天内获得了大概600个安装,但是有三个用户说他们无法安装,错误是“安装包没有正确的签名”。用户们的 共同点是他们都是1.5的固件。怎么会出现这样的事情呢?我在发布之前使用我的1.6固件的G2进行测试的,没有在1.5固件上测试过,这是因为我在开 发时功能和布局都是以1.5固件为基准做的,我很有信心不会在1.5上出现异常。于是我尝试在1.5固件的虚拟机上安装我的apk文件,果然遇到了用户 提到的错误。我检查了AndroidManifest.xml文件,miniSDK是3,也没有1.5不支持的配置选项,没问题的。于是Google 之,发现了解决方案。 原来1.5和它之前的固件都有bug,就是对资源文件(asset或者res目录下的文件)的命名解析的不好,具体的错误我也没有仔细看,大概的意思就 是,资源文件的名字和数量的组合和排列有可能会造成某些资源文件无法被解析。我们无法得知哪些名字是无法解析的,也不知道哪些资源文件数量是恰好不能解 析的。我们可以做的,就是在打包之后,发布之前,自己在1.5固件(或之前的固件)上进行安装测试。通过了就好,通不过就尝试改几个资源文件的名字,或 者增加一个或几个dummy文件,再打包,直到测试安装成功。 我的应用就是在我改了一个资源文件的名字之后通过了1.5的安装测试。 希望我说的明白。重点:发布之前,务必在1.5固件上进行测试安装。
    • Vincent Tsao
       
      良子大哥关于平台兼容性的宝贵经验
Vincent Tsao

既然我们有了china-android-dev,为什么还要创建这个Group? - 29 views

欢迎来自China Android Dev中的新成员,为了更好的使用Diigo Group和Diigo,建议安装 Diigo为大家提供的toolbar(FireFox, Chrome, IE等各个browser都有相应工具支持),方便收集网页资料,并摘取这些网页资料中的精华部分 ref: http://www.diigo.com/tools/toolbar

tips

Vincent Tsao

Backward Compatibility for Applications | Android Developers - 0 views

  •  
    官方关于android sdk各个版本的兼容性建议,正如官方建议的:"Testing is key"
Vincent Tsao

Android Developer Income Report - 2 views

  • Moreover I am not one of top developers nor any of my apps have been promoted by Android Market. I am just an one among of thousands of Android developers with not to well known apps. And what may be really surprising all my apps are free as Google do not allow developers from my country (Poland) to sell apps via Android Market!
  • So keep in mind these facts: None of my apps has been ever promoted in Top of Android Market I am providing only free apps (mostly due of Android Market limitations) Even if I would be able to sell apps I would not use it as main income source… (I believe that you still can make more from ads…)
  • X-Ray Scanner (over 268 000 downloads) Cracked Screen (over 182 000 downloads) Virtual Drums (over 20 000 downloads) Daily Beauty Tips (over 11 000 downloads) Don’t push it (over 6 500 downloads) WP Stats (over 4 000 downloads)
  • ...2 more annotations...
  • I have started to learn Android Development on April 2010. My first application was ready to be published on May. And it bring me first few dollars… I was not satisfied as I have been expecting that this app (WP Stats) will be really popular… Unfortunately it wasn’t… Anyway I have published a few more apps that got a lot more popularity… So here is my total income breakdown: May 2010 – $4.92 June 2010 – $138.87 July 2010 – $538.26 August 2010 – $920.00 September 2010 – $1545.45 October 2010 – $1059.31
  • October looks to be lower in earning but it happened only because I have not been updating any of my apps in this month (I have been moving to new house and had no time for it…). So as you may see income has not been high on the begging but with each month with regular updates and new apps it has been growing very rapidly!
Vincent Tsao

Android SDK Quick Tip: Sending Pictures the Easy Way - 0 views

  • Intent picMessageIntent = new Intent(android.content.Intent.ACTION_SEND);  picMessageIntent.setType("image/jpeg");    File downloadedPic =  new File(      Environment.getExternalStoragePublicDirectory(      Environment.DIRECTORY_DOWNLOADS),      "q.jpeg");    picMessageIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(downloadedPic));  
1 - 18 of 18
Showing 20 items per page