• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Maximum Refresh Rate of Widget

morty346

Lurker
I know that the default is 30 minutes, however I am looking at making a game in a widget

This would require millisecond responses.... has anyone messed with the AlarmClock Timing that is described to use instead to achieve this? does it work well?


I haven't finished the Software Arc for the project yet because I see a lot of complaints about this on the net, so need to know if this is feasable before I go for the adventure... but the game would consist of a large widget size of one screen... many areas to click on and interact with and multiple textured animations

Looks like I can draw to a canvas and then pop it up to the bitmap to do this... but that still confuses me a bit, so if anyone knows of some good tutorials I would greatly appreciate it

this is what I was told works:

Code:
Paint p = new Paint(); 
            p.setAntiAlias(true);
            p.setStyle(Style.STROKE);
            p.setStrokeWidth(8);
            p.setColor(0xFFFF0000);

            Bitmap bitmap = Bitmap.createBitmap(100, 100, Config.ARGB_8888);
            Canvas canvas = new Canvas(bitmap);
            canvas.drawArc(new RectF(10, 10, 90, 90), 0, 270, false, p);

           // RemoteViews views = new RemoteViews(updateService.getPackageName(), R.layout.main);
            RemoteViews updateViews = null;
            
            updateViews.setImageViewBitmap(R.id.canvas, bitmap);

            ComponentName componentName = new ComponentName(updateService, DashboardAppWidgetProvider.class);
            AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(updateService);
            appWidgetManager.updateAppWidget(componentName, views);

but I am struggling with the concepts of this code having an ID for the canvas and how to use that so I have not been able to test this code

(I am a experienced c/c++/c#/dx/opengl coder first time with android and java)

Thank you!
 
Back
Top Bottom