Creating a Home Screen App Widget on Android - Developer.com - 0 views
-
The Android system reuses Intents that match both action and scheme values—the "extras" values are not compared
-
In practice, this means the Intent for each App Widget identifier would actually be the same Intent. Fortunately, the solution is straightforward: define a scheme for your App Widget and use it to define unique Intent instances
-
// make this pending intent unique widgetUpdate.setData( Uri.withAppendedPath(Uri.parse( ImagesWidgetProvider.URI_SCHEME + "://widget/id/"), String.valueOf(appWidgetId)));
How to implement a Button on an Android Widget - Stack Overflow - 0 views
-
I am just getting started with Android development and I have created a nice little widget that displays some info on my home screen. However, I now want to implement a Button on my widget that updates the info in my widget TextView.
-
Solved - I can confirm that an Activity is NOT needed if you want create a Button to update an Android AppWidget. I have been able to implement my AppWidgetProvider class such that it registers an android.appwidget.action.APPWIDGET_UPDATE intent-filter with the Broadcast receiver in the AndroidManifest.xml, which then fires the onUpdate event in the AppWidgetProvider class (which in turn then runs the UpdateService).
-
The UpdateService in my AppWidgetProvider class then uses onHandleIntent to run a private buildUpdate method - which registers the onClick event with a call to setOnClickPendingIntent as follows:
- ...1 more annotation...
foursquared - Project Hosting on Google Code - 0 views
-
Open Source Foursquare client for Android.
前置摄像头意味着通过手势控制 Android | 谷安--谷奥Android专题站 - 0 views
-
你可以在 EyE-Sight 站点了解到更多关于这一功能的消息,也可以通过下面的视频来了解更多细节。 继续观看视频:
使用SoftReference软引用 - 成都心情 - BlogJava - 0 views
Handling User Interaction with Android App Widgets - Developer.com - 0 views
-
An App Widget uses a special display control called RemoteViews. Unlike a regular View, a RemoteViews control is designed to display a collection of View controls in another process. Consequently, you can't simply add a button handler because that code would run in your application process, not in the process displaying the RemoteViews object (in this case, the Home Screen process).
-
In order to handle user interaction with an App Widget, the following tasks must be performed: Set a unique click handler for each App Widget control Have the click handler send a command to a registered receiver Process the command received and perform any action necessary Update the App Widget to reflect the changes
Widget Design Guidelines | Android Developers - 1 views
-
In portrait orientation, each cell is 80 pixels wide by 100 pixels tall (the diagram shows a cell in portrait orientation)
-
In landscape orientation, each cell is 106 pixels wide by 74 pixels tall.
Android Developers Blog: Introducing home screen widgets and the AppWidget framework - 1 views
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.
-
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.
putExtra error on AppWidget - Android Developers | Google Groups - 0 views
-
I am just making some AppWidget and I want to pass some Strings through UpdateView to an Activity. But the Bundle is null. I try this: -Widget.java Intent defineIntent = new Intent(context, Visor.class); defineIntent.putExtra ("org.rss.androides.post2","artist"); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, defineIntent, 0); updateViews.setOnClickPendingIntent (R.id.widget, pendingIntent); -Viewer.java Bundle b = intent.getExtras(); if (b == null) { finish(); return; } b is always null.
-
Remember that PendingIntents aren't keyed using extras: http://groups.google.com/group/android-developers/msg/b296f43ae70c4587 You could hack the extras through by mangling them into Uri parameters, or if you're using a ContentProvider, just point to a specific row.
-
Or use PendingIntent.FLAG_UPDATE_CURRENT; just be careful that each active instance has its own unique Intent.
Creating a Home Screen App Widget on Android - Developer.com - 0 views
-
onReceive(): The default implementation of this method handles the BroadcastReceiver actions and makes the appropriate calls to the methods shown above. (Warning: A well-documented defect exists that requires the developer to handle certain cases explicitly. See the following note for more information.)
-
Creating a simple App Widget involves several steps: Create a RemoteView, which provides the user interface for the App Widget. Tie the RemoteView to an Activity that implements the AppWidgetProvider interface. Provide key App Widget configuration information in the Android manifest file.
-
An App Widget is basically just a BroadcastReceiver that handles specific actions.
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).
ListView/ListActivity limit items until last item reached, like in Android Market - And... - 0 views
-
These applications use an OnScrollListener to detect when the last item is displayed. When this happens, they load more items and add them to the list adapter.
Search | Android Developers - 0 views
-
Android's search framework provides a user interface in which users can perform a search and an interaction layer that communicates with your application, so you don't have to build your own search Activity. Instead, a search dialog appears at the top of the screen at the user's command without interrupting the current Activity.
Using the Android Search Dialog | Android Developers - 0 views
-
If your data is stored in a SQLite database on the device, performing a full-text search (using FTS3, rather than a LIKE query) can provide a more robust search across text data and can produce results significantly faster.
-
If your data is stored online, then the perceived search performance might be inhibited by the user's data connection. You might want to display a spinning progress wheel until your search returns.
-
<?xml version="1.0" encoding="utf-8"?><searchable xmlns:android="http://schemas.android.com/apk/res/android" android:label="@string/app_label" android:hint="@string/search_hint" ></searchable>