Skip to main content

Home/ Android Dev/ Group items tagged tech

Rss Feed Group items tagged

Vincent Tsao

请教,使用layout_gravity属性不能垂直居中 - China Android Dev | Google Groups - 0 views

  • 按我理解,layout_gravity 属性是用于设置View 与其容器的对齐关系的,但实际使用中 却发现 似乎不是这样,请看如下代码: <?xml version="1.0" encoding="utf-8"?> <LinearLayout     xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="vertical"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:background="#AA009988">     <TextView         android:id="@+id/my_view"         android:layout_width="220dip"         android:layout_height="100dip"         android:text="sdfasdfsdfsdf\nsdfjlwjesd"         android:background="#889900AA"         *android:layout_gravity="center"* /> </LinearLayout> 我为 TextView 设置了 *layout_gravity="center"*- ,本来它应该在父容器中 垂直和水平 居中的,但事实上只是水平居中了,垂直方向并未居中。 我再进一步通过 *layout_gravity="**center_vertical**"* ,但仍然无法垂直居中,请问这是为什么呢?
  • 你可以在最外面的 LinearLayout 加上android:gravity="center". Vertical LinearLayout中, layout_gravity 设置成center无法垂直剧中,是因 为container的排版被限制为从上到下, 试想一下,如果按照你的逻辑,假设第一个child layout_gravity设置成bottom,   第二个childlayout_gravity设置成top,  那么第一个就会跑到第二个下面了。 所以, 当你设置整个linearlayout为垂直, layout_gravity中, 只有 left, right, center_ horizontal 管用的。 tj
Vincent Tsao

RecognizerIntent | Android Developers - 0 views

  • Since: API Level 3
    • Vincent Tsao
       
      这样的话,android 1.5 以上的 OS 都使用这个intent了
  • Constants for supporting speech recognition through starting an Intent
Vincent Tsao

Authenticating against App Engine from an Android app - Nick's Blog - 0 views

  • Authentication with App Engine, regardless of where you're doing it, is a three-stage process: Obtain an authentication token. This can be done with ClientLogin for installed apps, for example, or with AuthSub for a webapp. When logging in directly to an application, this is the part of the login process where your user sees a Google signin screen. Take that authentication token, and use it to obtain an authentication cookie. Use that authentication cookie in all subsequent requests.
  • <uses-permission android:name="android.permission.GET_ACCOUNTS"></uses-permission> <uses-permission android:name="android.permission.USE_CREDENTIALS"></uses-permission> <uses-permission android:name="android.permission.INTERNET"></uses-permission>
Vincent Tsao

Android Dev Phone, Ubuntu and VMWare Server : Johan de Koning - 0 views

  • Create a new file (as root) sudo gedit /etc/udev/rules.d/50-android.rules with the following content SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666" Make sure that the text after {idVendor} is the same as the device id found when using the lsusb command. Save and exit the editor To make execution of the rule possible, perform a chmod sudo chmod a+rx /etc/udev/rules.d/50-android.rules To make the rule active, restart udev sudo /etc/init.d/udev restart
  • You can perform a check, to see that the Android Dev Phone is shared with Ubuntu, by opening a Terminal (inside Ubuntu. Open a VMWare Remote Console to make use of the Ubuntu) and type the following command lsusb A list of USB devices will be shown. For example: Bus 002 Device 001: ID ld6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 004: ID 0bb4:0c02 High Tech Computer Corp. Bus 001 Device 001: ID ld6b:0002 Linux Foundation 2.0 root hub
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

List view with textviews and imageview, best practices - Android Developers | Google Gr... - 0 views

  • 1. you can look at the video from Google IO conference 2009, called Turbo charging your UI's by Romain Guy; he discussed some of the optimizations you can do when working with ListViews. 2. You can read Mark Murphy's series of ListView tutorials at android guys titled Fancy ListViews: http://www.google.co.in/url?sa=t&source=web&ct=res&cd=4&ved=0CBYQFjAD...
Vincent Tsao

Lazy Loading Images in a ListView - consensus approach? - Android Developers | Google G... - 0 views

  • I haven't looked in details at the 3 other approaches but I know that a big difference between what I do in Shelves and what I've seen done in other places is how user interaction is handled. Shelves listens to scroll events on the ListView and tries to identify taps vs scrolls vs fling to always give priority to the UI. For instance, when you touch the screen to stop a fling, Shelves starts loading images, but does so only after a very short delay so that if you are touching the screen to fling some more, the fling animation won't stutter because of the extra work load. But that's details.
    • Vincent Tsao
       
      From Romain Guy, the author of Shelves app
Vincent Tsao

Fancy ListViews, Part Six: Custom Widget - 0 views

  •  
    正是我想要的 :)
‹ Previous 21 - 40 of 127 Next › Last »
Showing 20 items per page