Skip to main content

Home/ Android Dev/ Group items tagged examples

Rss Feed Group items tagged

Jac Londe

Android Hello World example - 1 views

  •  
    For beginners
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

myandroidwidgets - Project Hosting on Google Code - 0 views

  • A bunch of sample apps for Android. Simple workarounds and examples for doing things on Android. Custom Progress Bar - A customized Progress Bar for android with your own animation Drag and Drop widgets on Android Ongoing notifications on Android HTML with images in a Text View Custom Expandable List Views on Android Custom List View - Phonebook Example Custom Title Bar Android WebView, Javascrip and CSS Unzip files on Android
Vincent Tsao

Android Tutorial - 0 views

  •  
    lots of useful example here
Vincent Tsao

Onscreen Input Methods | Android Developers - 0 views

  • The android:inputType attribute has three pieces: The class is the overall interpretation of characters. The currently supported classes are text (plain text), number (decimal number), phone (phone number), and datetime (a date or time). The variation is a further refinement on the class. In the attribute you will normally specify the class and variant together, with the class as a prefix. For example, textEmailAddress is a text field where the user will enter something that is an e-mail address (foo@bar.com) so the key layout will have an '@' character in easy access, and numberSigned is a numeric field with a sign. If only the class is specified, then you get the default/generic variant. Additional flags can be specified that supply further refinement. These flags are specific to a class. For example, some flags for the text class are textCapSentences, textAutoCorrect, and textMultiline.
  •     <EditText android:id="@+id/edtInput"        android:layout_width="0dip"        android:layout_height="wrap_content"        android:layout_weight="1"        android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine"        android:imeOptions="actionSend|flagNoEnterAction"        android:maxLines="4"        android:maxLength="2000"        android:hint="@string/compose_hint"/>
Vincent Tsao

Can I Use this Intent? | Android Developers - 0 views

  • This article describes a technique you can use to find out whether the system contains any application capable of responding to the intent you want to use. The example below shows a helper method that queries the system package manager to determine whether there's an app that can respond to a specified intent. Your application can pass an intent to the method and then, for example, show or hide user options that the user would normally use to trigger the intent.
  • /** * Indicates whether the specified action can be used as an intent. This * method queries the package manager for installed packages that can * respond to an intent with the specified action. If no suitable package is * found, this method returns false. * * @param context The application's environment. * @param action The Intent action to check for availability. * * @return True if an Intent with the specified action can be sent and *         responded to, false otherwise. */public static boolean isIntentAvailable(Context context, String action) {    final PackageManager packageManager = context.getPackageManager();    final Intent intent = new Intent(action);    List<ResolveInfo> list =            packageManager.queryIntentActivities(intent,                    PackageManager.MATCH_DEFAULT_ONLY);    return list.size() > 0;}
  • @Overridepublic boolean onPrepareOptionsMenu(Menu menu) {    final boolean scanAvailable = isIntentAvailable(this,        "com.google.zxing.client.android.SCAN");    MenuItem item;    item = menu.findItem(R.id.menu_item_add);    item.setEnabled(scanAvailable);    return super.onPrepareOptionsMenu(menu);}
Kiran Kuppa

apps-for-android - Sample Applications for the Android platform - Google Project Hosting - 2 views

  •  
    "A collection of useful, open source applications that demonstrate basic features of the Android platform."
Kiran Kuppa

A Visual Guide to Relative Layouts In Android » Mark Lapasa - 0 views

  •  
    " I will walk through the 4 kinds of Relative Layout use cases. 1.Target view position in relation to parenting View Group (i.e. a layout container) 2.Target view alignment in relation to parenting View Group 3.Target view position in relation to another View 4.Target view alignment in relation to another View We'll use Jack and Jill buttons to demonstrate this. The first two categories are in relation to a parent layout (Jack and the parent view group). The last two categories show laying out in relation to another View (i.e. Jack + Jill)"
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
Vincent Tsao

Supporting Multiple Screens | Android Developers - 0 views

  • The density of a screen is important because, other things being equal, a UI element (such as a button) whose height and width are defined in terms of screen pixels will appear larger on the lower density screen and smaller on the higher density screen.
  • The density-independent pixel is equivalent to one physical pixel on a 160 dpi screen, the baseline density assumed by the platform (as described later in this document). At run time, the platform transparently handles any scaling of the dip units needed, based on the actual density of the screen in use. The conversion of dip units to screen pixels is simple: pixels = dips * (density / 160). For example, on 240 dpi screen, 1 dip would equal 1.5 physical pixels. Using dip units to define your application's UI is highly recommended, as a way of ensuring proper display of your UI on different screens.
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

How to do ListView dynamic item growing? - Android Developers | Google Groups - 1 views

  • OnScrollListner there is an example in the API demos. On Tue, Oct 13, 2009 at 2:12 PM, wangxueming <m.wongxm...@gmail.com> wrote: > Now I want to make a  ListView,with 20 items, > Then when it scroll to the end, > I get new data and add to the end of ListView dynamic. > Just Like ListView in Android Market.
  • You can try my EndlessAdapter for that: http://github.com/commonsguy/cwac-endless
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
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

用google adsense的小心了!!!! - China Android Dev | Google Groups - 0 views

  • google最后给的判决书: Hi, After further review from our abuse team we have confirmed that your account that was closed was modifying the ad behavior which is strictly prohibited as stated in the AdSense policies. These types of violations pose a significant risk to advertisers and for this reason we can no longer work with you through any partnering AdSense account or product offering. This will be the final communication about this issue. Please do not reply to this email as you will not receive a response. Thank you for your understanding. Google AdSense 我们自始至终都不知道原因。
  • 我Google了下 "modifying the ad behavior " 就是指你修改了 Google提供的 adsense js code 或者 sdk 唯一有可能的就是这里了 GoogleAdView adView = (GoogleAdView) activity.findViewById(R.id.ad<http://r.id.ad/> ); if (adView != null) { View vc = adView.getCurrentView(); if (vc instanceof WebView) { ((WebView) vc).destroy(); } View vn = adView.getNextView(); if (vn instanceof WebView) { ((WebView) vn).destroy(); } } 因为用了adsense之后 我们的程序老是crash 从stack trace看是因为Google adsense sdk 引起的. 资源没有释放. 然后去Adsense的那个mail list AFMA 问了 碰到2个都有同样问题的 然后有人给了个code 因为adsense sdk没有destroy ad view  所以要手动destroy下 我们就在每个有ads的activty的 onDestroy 加上这段 就好了 程序没有crash了 结果就被搞了 连负责我们android adsense sales都事先不知道 adsense team就直接把我们封了 还在beta 测试阶段的东西 还有bug  我们只是加了这个保证他资源正常释放不会影响到我们程序 结果就挂了 而且Google的态度巨NX无比 连个申述的途径都没有  只是给了个link类似事后调查
  • 我刚刚给我的sale发了一封信: Hi Sunil, It has been long that I haven't talked to you. I have a question, when I went to the application register page, I found the page layout was changed and some of my apps were gone. For example UK TV Guide, Australia TV Guide, etc. Also, the published status are all "false". I am confused because I am still seeing my ads are clicked in the daily report. Is there anything wrong? I am nervous because I just knew that an AdSense developer's account was disabled without any warning,  and the developers themselves don't know the reason. I don't want that happened on me so I really appreciate your comment. below is the letter in AFMA group. Looking forward to your reply. Thanks. Cheers, Luke 接下来我引用了superdroid的信。看看他怎么说吧。
  • ...1 more annotation...
  • 把这句抄下来了,大家以后小心了。 Ad Behavior AdSense code may not be altered, nor may the standard behavior, targeting or delivery of ads be manipulated in any way that is not explicitly permitted by Google. For instance, clicking Google ads may not result in a new browser window being launched. 我猜是不是可以找google总部投诉一下这个部门
1 - 20 of 22 Next ›
Showing 20 items per page