Skip to main content

Home/ Android Dev/ Group items tagged news

Rss Feed Group items tagged

Vincent Tsao

[Disccuss] lasy load of images in ListView - 2 views

ah~ ,看来Diigo groups展示代码的样式得改进了.....

android "lazy load" listview tech

Vincent Tsao

Android - How do I do a lazy load of images in ListView - Stack Overflow - 2 views

  • public class DrawableManager { private final Map drawableMap; public DrawableManager() { drawableMap = new HashMap(); } public Drawable fetchDrawable(String urlString) { if (drawableMap.containsKey(urlString)) { return drawableMap.get(urlString); } Log.d(this.getClass().getSimpleName(), "image url:" + urlString); try { InputStream is = fetch(urlString); Drawable drawable = Drawable.createFromStream(is, "src"); drawableMap.put(urlString, drawable); Log.d(this.getClass().getSimpleName(), "got a thumbnail drawable: " + drawable.getBounds() + ", " + drawable.getIntrinsicHeight() + "," + drawable.getIntrinsicWidth() + ", " + drawable.getMinimumHeight() + "," + drawable.getMinimumWidth()); return drawable; } catch (MalformedURLException e) { Log.e(this.getClass().getSimpleName(), "fetchDrawable failed", e); return null; } catch (IOException e) { Log.e(this.getClass().getSimpleName(), "fetchDrawable failed", e); return null; } } public void fetchDrawableOnThread(final String urlString, final ImageView imageView) { if (drawableMap.containsKey(urlString)) { imageView.setImageDrawable(drawableMap.get(urlString)); } final Handler handler = new Handler() { @Override public void handleMessage(Message message) { imageView.setImageDrawable((Drawable) message.obj); } }; Thread thread = new Thread() { @Override public void run() { //TODO : set imageView to a "pending" image Drawable drawable = fetchDrawable(urlString); Message message = handler.obtainMessage(1, drawable); handler.sendMessage(message); } }; thread.start(); } private InputStream fetch(String urlString) throws MalformedURLException, IOException { DefaultHttpClient httpClient = new DefaultHttpClient(); HttpGet request = new HttpGet(urlString); HttpResponse response = httpClient.execute(request); return response.getEntity().getContent(); } }
  •  
    shared by Altchen
  •  
    呵呵.我看那框那么小还不太敢复制代码.= =!
Kiran Kuppa

New Layout Widgets: Space and GridLayout - 0 views

  •  
    "Ice Cream Sandwich (ICS) sports two new widgets that have been designed to support the richer user interfaces made possible by larger displays: Space and GridLayout."
Vincent Tsao

Android Developers Blog: Android Market Client Update - 1 views

  • The Android Market engineering team has been hard at work on improving the Android Market experience for users and developers. Today, I’m pleased to announce a significant update to the Android Market client. Over the next two weeks, we’ll be rolling out a new Android Market client to all devices running Android 1.6 or higher.This new Market client introduces important features that improve merchandising of applications, streamline the browse-to-purchase experience, and make it easier for developers to distribute their applications.
  • To make it easier for developers to distribute and manage their products, we will introduce support for device targeting based on screen sizes and densities, as well as on GL texture compression formats. We are also increasing the maximum size for .apk files on Market to 50MB, to better support richer games.
  • To streamline the browse-to-purchase experience, users can now access all the information about an application on a single page without the need to navigate across different tabs.
Vincent Tsao

Binding to Data with AdapterView | Android Developers - 0 views

  • Spinner s2 = (Spinner) findViewById(R.id.spinner2);Cursor cur = managedQuery(People.CONTENT_URI, PROJECTION, null, null);     SimpleCursorAdapter adapter2 = new SimpleCursorAdapter(this,    android.R.layout.simple_spinner_item, // Use a template                                          // that displays a                                          // text view    cur, // Give the cursor to the list adatper    new String[] {People.NAME}, // Map the NAME column in the                                         // people database to...    new int[] {android.R.id.text1}); // The "text1" view defined in                                     // the XML template                                         adapter2.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);s2.setAdapter(adapter2);
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

Is it possible to update a widget from an Activity? - Android Developers | Google Groups - 0 views

  • An AppWidgetProvider is a BroadcastReceiver. That gives you two possibilities right off the bat: 1. Have it also handle whatever other Intents you were planning on setting up with a separate BroadcastReceiver, or 2. Send an Intent from whatever component you want to the AppWidgetProvider. In other words, don't worry about trying to talk directly to the app widget (which I suspect is impossible) -- just talk to your code that already talks to the app widget.
    • Vincent Tsao
       
      good explanation
  • I update my widget from within my app, when I delete/add entries to a list. To do this, I have a method (updateWidget) and a static String (UPDATE_ACTION). My updateWidget() method sends a broadcast which is received by the widget class and then calls onUpdate() with the appropriate params: private void updateWidget() {                 Intent i = new Intent(this, TVWidget.class);                 i.setAction(TVWidget.UPDATE_ACTION);                 sendBroadcast(i);         } In TVWidget class: @Override         public void onReceive(Context context, Intent intent) {                 String action = intent.getAction();                 if (action != null && action.equals(UPDATE_ACTION)) {                         final AppWidgetManager manager = AppWidgetManager.getInstance (context);                         onUpdate(context, manager,                                         manager.getAppWidgetIds(new ComponentName(                                                         context, TVWidget.class)                                         )                         );                 }                 else {                         super.onReceive(context, intent);                 }         } This seems to work fine.
Vincent Tsao

Android Developers Blog: Twitter for Android: A closer look at Android's evolving UI pa... - 1 views

  • Additionally, you can feel free to use the Search bar selection mechanism as a replacement for tabs since it’s really just a fast pivot on a data set. If you have more than 3 data sets, tabs become problematic since no more than 3 can be onscreen at once. For example, look at how we implemented the Profile switching mechanism below:
  • The good news for developers is you get this highly functional contacts feature for free if users choose to sync contact information into your app
    • Vincent Tsao
       
      使用tab & pop-up window的方式来切换不同的数据集,作为tab的一种替换
  • The good news for developers is you get this highly functional contacts feature for free if users choose to sync contact information into your app. QuickContact for Android provides instant access to a contact's information and communication modes.
  • ...3 more annotations...
  • QuickActions can be used as a replacement for our traditional dialog invoked by long press.
  • The dashboard pattern serves as a home orientation activity for your users. It is meant to include the categories or features of your application. We recommend including an Action bar on this screen as well. The dashboard can be static or dynamic. For example, in the case of our dashboard for Twitter, we used the goodness of Live Wallpapers introduced in 2.1 to create an animated dashboard complete with real-time trend bubbles and the Twitter bird silhouette.
  • You keep a search history so users upon returning to the search activity can have quick one-button access to previous searches.
Vincent Tsao

How to disable a button on an appwidget? | Hello Android - 0 views

  • RemoteViews can't manipulate a buttons enabled/disabled state, but it can modify its visibility. So the trick is to have two buttons, the real one, and an other which is designed to look like the real one in disabled state, and change witch one is visible.
  • <Button android:id="@+id/startbutton" android:text="Start" android:visibility="visible"></Button> <Button android:id="@+id/startbutton_disabled" android:text="Start" android:clickable="false" android:textColor="#999999" android:visibility="gone"></Button>   <Button android:id="@+id/stopbutton" android:text="Stop"  android:visibility="gone"></Button> <Button android:id="@+id/stopbutton_disabled" android:text="Stop" android:clickable="false" android:textColor="#999999" android:visibility="visible"></Button>
  • RemoteViews remoteView = new RemoteViews(context.getPackageName(), R.layout.widget); remoteView.setViewVisibility(R.id.startbutton, View.GONE); remoteView.setViewVisibility(R.id.startbutton_disabled, View.VISIBLE); remoteView.setViewVisibility(R.id.stopbutton, View.VISIBLE); remoteView.setViewVisibility(R.id.stopbutton_disabled, View.GONE); AppWidgetManager.getInstance(context).updateAppWidget(appWidgetId, remoteView);
  • ...1 more annotation...
  • RemoteViews remoteView = new RemoteViews(context.getPackageName(), R.layout.widget); remoteView.setViewVisibility(R.id.startbutton, View.VISIBLE); remoteView.setViewVisibility(R.id.startbutton_disabled, View.GONE); remoteView.setViewVisibility(R.id.stopbutton, View.GONE); remoteView.setViewVisibility(R.id.stopbutton_disabled, View.VISIBLE); AppWidgetManager.getInstance(context).updateAppWidget(appWidgetId, remoteView);
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

using Java to get a file's md5 checksum? - Stack Overflow - 0 views

  • java.security.DigestInputStream
  • MessageDigest md = MessageDigest.getInstance("MD5");InputStream is = new FileInputStream("file.txt");try {  is = new DigestInputStream(is, md);  // read stream to EOF as normal...}finally {  is.close();}byte[] digest = md.digest();
Vincent Tsao

Selecting text in a WebView? - Stack Overflow - 1 views

  • From the class that extends WebView: public void selectAndCopyText() {    try {        Method m = WebView.class.getMethod("emulateShiftHeld", null);        m.invoke(this, null);    } catch (Exception e) {        throw new AssertionError(e);    }} And then you have to use ClipboardManager to watch for new text. P.S. Historical note: this hack is based on Android 1.5 WebView implementation.
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 Cloud to Device Messaging Framework - Google Projects for Android - 1 views

  • It allows third-party application servers to send lightweight messages to their Android applications. The messaging service is not designed for sending a lot of user content via the messages. Rather, it should be used to tell the application that there is new data on the server, so that the application can fetch it. C2DM makes no guarantees about delivery or the order of messages. So, for example, while you might use this feature to tell an instant messaging application that the user has new messages, you probably would not use it to pass the actual messages. An application on an Android device doesn’t need to be running to receive messages. The system will wake up the application via Intent broadcast when the the message arrives, as long as the application is set up with the proper broadcast receiver and permissions.
  • It uses an existing connection for Google services. This requires users to set up their Google account on their mobile devices.
  • C2DM imposes the following limitations: The message size limit is 1024 bytes. Google limits the number of messages a sender sends in aggregate, and the number of messages a sender sends to a specific device
  • ...1 more annotation...
  • The ClientLogin token authorizes the application server to send messages to a particular Android application. An application server has one ClientLogin token for a particular 3rd party app, and multiple registration IDs. Each registration ID represents a particular device that has registered to use the messaging service for a particular 3rd party app.
Vincent Tsao

Category types - Android Market Help - 1 views

  • You're required to select a category for your application. On December 22, 2010, the available category types changed in the Developer Console. The original categories were renamed, merged, or split into new categories. We believe this will enhance the user experience significantly; the new categories will rolling out to users over the course of a week.
  •  
    Android Market分类更加细致了
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));  
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手机的野心_Google Android_cnBeta.COM - 0 views

  • 新闻来源:21世纪网 作者:小刀马
  • 近日,市场又有消息称,谷歌将联合华为推低价Android手机。据悉,谷歌计划在中国和印度推动Android手机软件的发展,它们也试图为当地的开发者们寻找更多的生财之路。而为了吸引开发者们加入到Android操作系统中来,谷歌将提供工具,帮助他们销售产品,如订阅、虚拟货物及其它的形式。同时,谷歌还准备将Android操作系统植入低价手机中,这些手机由华为和 LG电子制造,主要面向亚洲和欧洲,而这两大地区正是诺基亚的腹地
  • Gartner表示,2009年移动广告市场只有10亿美元规模,但2013年将增长到135亿美元。此外,在移动应用上,谷歌落后于苹果。Android只有6.5万个应用程序,而苹果却有将近20万个。Gartner预计,2012年Android将成为全球第二大操作系统,超过苹果的iPhone OS,仅次于诺基亚Symbian
  • ...5 more annotations...
  • 如何才能更快速地让Android进入一个发展的快车道?无疑引入更多的开放者追捧这个系统是非常关键的。这也是苹果iPhone之所以成功的关键所在
  • 为了能够吸引到更多的开发者,谷歌试图帮助开发者通过软件赚更多钱,比如提供更简单的支付方式。
  • 目前大多的Android开发者通过广告赚钱,或者是一次性费用赚钱。如此一来,它们的收入比苹果平台少得多。苹果平台每年光是下载应用的费用就达44亿美元,应用商店每年占比77%,而Android只有9%。这是谷歌的软肋,也是谷歌Android没有苹果系统风靡的原因所在。为此,谷歌希望能打入低端手机市场,获得更多用户的使用,从而刺激Android手机系统的用户基数的增长,再带动第三方软件开发者对这个市场的关注和投入。谷歌也表示,eBay的PayPal已经向Android提供应用程序
  • 低端市场本来是很多制造大鳄并不十分感兴趣的市场,但是中国山寨市场的火爆让人们彻底改变了对这个市场的态度,大量的低端品牌涌入市场,并且获得了强大的生命力,本身就说明市场对该类产品的认可。这是一个非常值得谷歌思索的地方。于是,谷歌开始正式切入这个市场,并积极布局
  • 既然在硬件制造方面,谷歌难以和同类的竞争产品一争高下,那么改弦易张,进行有针对性地市场布局,比如支持更多的厂商推出Android产品,以及支持更多的第三方开发者进入到谷歌的阵营,或许这将是谷歌在移动市场竞争的最有力武器。而低端市场无疑是一个突破口,如果能够获得成功,那将星星之火可以燎原
1 - 20 of 62 Next › Last »
Showing 20 items per page