Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8183759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:15:49+00:00 2026-06-07T01:15:49+00:00

I am in the planning stages for my next Android project. I would like

  • 0

I am in the planning stages for my next Android project. I would like to create widget for my current garage door opener app. Currently it is just an app and there is a refresh button at the bottom that updates the status of the door (open or closed). I would like for the network connected device in my garage to send a c2dm “push” message any time the status of my door changes so that I can do away with the refresh button all together. If I create a home screen widget that shows the status of the door, will it be able to update in real-time as these c2dm messages come in, or can widgets only be updated on a timer?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T01:15:52+00:00Added an answer on June 7, 2026 at 1:15 am

    Yes, You can have your widget updated as the C2DM(now GCM) come in.

    Once your app receives the C2DM(or GCM) message you will either have to get your update from your server, or retrieve it from the message if you are sending it as payload with the message, and store it locally. Then you will have to start the update service for your widget, which you probably already are using. It is difficult to say exactly how to implement this without knowing more about your app. Generally the widget will have a service that updates. Below is a generic update service:

    public static class UpdateService extends Service {
        @Override
        public void onStart(Intent intent, int startId) {
            RemoteViews updateViews = buildUpdate(this);
    
            // Push update for this widget to the home screen
            ComponentName thisWidget = new ComponentName(this, Widget.class);
            AppWidgetManager manager = AppWidgetManager.getInstance(this);
            manager.updateAppWidget(thisWidget, updateViews);
        }
    
    
        public RemoteViews buildUpdate(Context context) {
           // process the updated view here.  Probably would pull data from DB and update views       //accordingly
            return updateViews;
        }
    
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently in the planning stages of a game for google app engine,
I am in the planning stages for a task server development project. I would
I'm at the planning stages of my first proper android app. Part of the
I'm currently in the planning stages for a real-time multiplayer game that would be
I am currently in the planning stages of building a simple Django web app
I am in the planning stages of a .NET desktop app that will communicate
Iam planning to create an app, and not to publish it at the google
I am in the planning stages of a database app for personal use. I
I'm in the planning stages of a web site project and deciding on whether
Background I'm at the planning stages of a DIY project that'll help me automate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.