Skip to main content

Home/ Android Dev/ Group items tagged html

Rss Feed Group items tagged

Vincent Tsao

Icons for submenu items doesn't show up - Android Developers | Google Groups - 0 views

  • The fact that sub-menus don't support icons. http://developer.android.com/intl/fr/guide/topics/ui/menus.html <http://developer.android.com/intl/fr/guide/topics/ui/menus.html> *Icon Menu * This is the collection of items initially visible at the bottom of the screen at the press of the MENU key. It supports a maximum of six menu items. *These are the only menu items that support icons* and the only menu items that *do not* support checkboxes or radio buttons.
  • Try to use PopUpWindow <http://developer.android.com/reference/android/widget/PopupWindow.html>class. Here you have an example<http://www.anddev.org/how_to_create_a_popupwindow-t1259.html>
Vincent Tsao

Fragments | Android Developers - 1 views

  • If you add multiple changes to the transaction (such as another add() or remove()) and call addToBackStack(), then all changes applied before you call commit() are added to the back stack as a single transaction and the BACK key will reverse them all together.
    • Vincent Tsao
       
      what's the point to provide such  mechanism?
  • The most significant difference in lifecycle between an activity and a fragment is how one is stored in its respective back stack. An activity is placed into a back stack of activities that's managed by the system when it's stopped, by default (so that the user can navigate back to it with the BACK key, as discussed in Tasks and Back Stack). However, a fragment is placed into a back stack managed by the host activity only when you explicitly request that the instance be saved by calling addToBackStack() during a transaction that removes the fragment.
  • In some cases, you might need a fragment to share events with the activity. A good way to do that is to define a callback interface inside the fragment and require that the host activity implement it. When the activity receives a callback through the interface, it can share the information with other fragments in the layout as necessary.
  •  
    好特別、好酷的一個類
Vincent Tsao

Avoiding Memory Leaks | Android Developers - 0 views

  • As part of my job, I ran into memory leaks issues in Android applications and they are most of the time due to the same mistake: keeping a long-lived reference to a Context.
  • There are two easy ways to avoid context-related memory leaks. The most obvious one is to avoid escaping the context outside of its own scope. The example above showed the case of a static reference but inner classes and their implicit reference to the outer class can be equally dangerous. The second solution is to use the Application context. This context will live as long as your application is alive and does not depend on the activities life cycle. If you plan on keeping long-lived objects that need a context, remember the application object. You can obtain it easily by calling Context.getApplicationContext() or Activity.getApplication().
  • In summary, to avoid context-related memory leaks, remember the following: Do not keep long-lived references to a context-activity (a reference to an activity should have the same life cycle as the activity itself) Try using the context-application instead of a context-activity Avoid non-static inner classes in an activity if you don't control their life cycle, use a static inner class and make a weak reference to the activity inside. The solution to this issue is to use a static inner class with a WeakReference to the outer class, as done in ViewRoot and its W inner class for instance A garbage collector is not an insurance against memory leaks
Simon Pan

Custom Drawing | Android Developers - 1 views

  • Creating objects ahead of time is an important optimization. Views are redrawn very frequently, and many drawing objects require expensive initialization. Creating drawing objects within your onDraw() method significantly reduces performance and can make your UI appear sluggish.
    • Simon Pan
       
      將物件在初始化時就實例化是很重要的概念,onDraw()的運作速度很快,如困每一個Paint畫圖物件都臨時才在onDraw()產生,將會大幅下降整体程式的流暢效能。
  • If your view doesn't need special control over its size, you only need to override one method: onSizeChanged().
  • is mandatory.
Simon Pan

App Widgets | Android Developers - 1 views

  • To find your minimum width and height in density-independent pixels (dp), use this formula: (number of cells * 74) - 2
    • Simon Pan
       
      why i can't highlight?
    • Vincent Tsao
       
      FYI: You may need a toolbar to highlight, http://www.diigo.com/tools/toolbar
  • how often the App Widget framework should request an update from the AppWidgetProvider by calling the onUpdate() method
  • exactly on time
  • ...6 more annotations...
  • programmatically interface with the App Widget, based on broadcast events.
  • programmatically interface with the App Widget, based on broadcast events.
  • programmatically interface with the App Widget, based on broadcast events.
  • only the event broadcasts
  • when each App Widget is added to a host
  • it includes a loop that iterates through each entry in appWidgetIds,
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
Simon Pan

Service | Android Developers - 0 views

  • avoid
    • Simon Pan
       
      如果在Service裡做了要做的事,它們還是在UI thread裡做事情,而不是在什麼別的thread做事情。但是Service很特別,它又不是一個執行緒,因為通常Service要做的事情都蠻耗時的,萬一Service算是執行緒,那麼就會強碰到系統的ANR機制。
  • A facility for the application to tell the system about something it wants to be doing in the background
  • A facility for an application to expose some of its functionality to other applications.
  • ...3 more annotations...
  • two reasons
  • depending on the value they return from onStartCommand(): START_STICKY is used for services that are explicitly started and stopped as needed,
  • then take the service out of the started state and don't recreate until a future explicit call to Context.startService(Intent).
Simon Pan

In-app Billing Overview | Android Developers - 1 views

  • nonce
    • Simon Pan
  • launches the pending intent
  • checkout flow finishes
  • ...22 more annotations...
  • sends your application a notification message
  • you must send a confirmation
  • will continue sending IN_APP_NOTIFY messages
  • should not
  • until you have delivered the item to the user.
  • will still receive an IN_APP_NOTIFY broadcast intent
  • must be able to handle IN_APP_NOTIFY messages
  • references a specific request ID
  • is installed
  • reinstalled.
  • even though you never initiated the purchase.
  • must handle
  • it usually stops sending IN_APP_NOTIFY intents
  • even though your application has sent a CONFIRM_NOTIFICATIONS message. This can occur if a device loses network connectivity while you are sending the CONFIRM_NOTIFICATIONS message.
  • You can do this by checking the orderID
  • even though your application has not sent a REQUEST_PURCHASE message.
  • may receive
  • informing the application that there is a purchase state change.
  • This applies only to items that have their purchase type set to "managed per user account."
  • signs the JSON string that is contained in the PURCHASE_STATE_CHANGED
  • it includes the signed JSON string (unencrypted) and the signature.
  • you can use the public key portion of your RSA key pair to verify the signature.
Jac Londe

Getting Started | Android Developers - 0 views

  • Getting Started Welcome to Training for Android developers. Here you'll find sets of lessons within classes that describe how to accomplish a specific task with code samples you can re-use in your app. Classes are organized into several groups you can see at the top-level of the left navigation. This first group, Getting Started, teaches you the bare essentials for Android app development. If you're a new Android app developer, you should complete each of these classes in order:
Vincent Tsao

Android Endless List - Stack Overflow - 0 views

  • 5 down vote accepted One solution is to implement an OnScrollListener and make changes (like adding items, etc.) to the ListAdapter at a convenient state in its onScrollStateChanged method. The following ListActivity shows a list of integers, starting with 40, adding 10 per scroll-stop.
  • public class Test extends ListActivity implements OnScrollListener {    Aleph0 adapter = new Aleph0();    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setListAdapter(adapter);         getListView().setOnScrollListener(this);    }    public void onScroll(AbsListView v, int i, int j, int k) { }    public void onScrollStateChanged(AbsListView v, int state) {        if(state == OnScrollListener.SCROLL_STATE_IDLE) {                adapter.count += 10;                adapter.notifyDataSetChanged();        }    }    class Aleph0 extends BaseAdapter {        int count = 40;        public int getCount() { return count; }        public Object getItem(int pos) { return pos; }        public long getItemId(int pos) { return pos; }        public View getView(int pos, View v, ViewGroup p) {                TextView view = new TextView(Test.this);                view.setText("entry " + pos);                return view;        }    }}
  • You should obviously use separate threads for long running actions (like loading web-data) and might want to indicate progress in the last list item (like the market or gmail apps do).
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

webView load Data problem - Android Beginners | Google Groups - 0 views

  • sagar wrote: > Hello, > I have following code to display webview's background. > wv.loadData("<html><body background=\"file:///android_asset/lbh.png > \">"+data[0],"text/html","utf-8"); > here the data[0] contains the data to be displayed... > Data is displayed fine.. > but background is not displayed. > I can only use this method..i dont knw why i can t access android > assets.. > I have placed that image in assets folder already.. Try loadDataWithBaseUrl() instead of loadData(), supplying some bogus value for the base URL (e.g., fake://why/o/why/is/this/needed).
    • Vincent Tsao
       
      用loadDataWithBaseURL接口才能访问asset中的资源文件,且baseurl不能为null
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

Intel 公布可运行 Android 的 Atom 芯片的技术细节 | 谷安--谷奥Android专题站 - 0 views

  • 我们都知道Intel一直在试图将Android带到自己的Atom平台上,1个月前他们宣布了Atom已经可以成功运行Android和Meego系统,今天他们又透露了这颗Atom芯片的一些技术细节。 这颗Atom芯片属于Z6xx系列,在手机上可达到1.5GHz的主频,在平板上更是可以摸高到1.9GHz的速度,足以提供1080p视频的解码和720p视频的录制,帮助3D显卡闲置功耗降低50倍以上,等于多赋予电池10天的待机。这个新的芯片组应该可以提供长达2天的音频回放和4-5小时的视频浏览。 对Android的支持方面,Z6xx平台可支持标准的WiFi、3G/HSPA和WiMAX无线连接。之前传说Google和索尼联手打造的Android TV就内置了Intel的Atom芯片,那么很可能就是Z6xx系列,我们会在5月19日的Google I/O大会上见到运行Android的Atom芯片的庐山真面目。
Vincent Tsao

Android Developers Blog: Introducing Renderscript - 2 views

  • Renderscript is a key new Honeycomb feature which we haven’t yet discussed in much detail
  • Renderscript is a new API targeted at high-performance 3D rendering and compute operations. The goal of Renderscript is to bring a lower level, higher performance API to Android developers. The target audience is the set of developers looking to maximize the performance of their applications and are comfortable working closer to the metal to achieve this
  • Renderscript has been used in the creation of the new visually-rich YouTube and Books apps. It is the API used in the live wallpapers shipping with the first Honeycomb tablets.
  •  
    请问这篇在讲啥啊,有看沒懂
  •  
    这有篇中文的: http://android.guao.hk/posts/honeycomb-renderscript-detailed-the-balls.html 不过不做游戏和动画效果的,估计用的少
Vincent Tsao

FrameLayout | Android Developers - 1 views

  • FrameLayout is designed to block out an area on the screen to display a single item. You can add multiple children to a FrameLayout, but all children are pegged to the top left of the screen. Children are drawn in a stack, with the most recently added child on top. The size of the frame layout is the size of its largest child (plus padding), visible or not (if the FrameLayout's parent permits). Views that are GONE are used for sizing only if setConsiderGoneChildrenWhenMeasuring() is set to true.
    • Vincent Tsao
       
      FrameLayout才是最有潜力的布局方式
Vincent Tsao

Android 3.0 Preview SDK | Android Developers - 0 views

  • Once you have installed these components, open your SDK directory and navigate to docs/sdk/ and open index.html in your browser.
    • Vincent Tsao
       
      这个文档还真是藏得很隐蔽!
1 - 20 of 143 Next › Last »
Showing 20 items per page