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

  • SEARCH
  • Home
  • 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 9093243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:03:03+00:00 2026-06-16T23:03:03+00:00

I have Datastore Class and I use this class to try GCM . I

  • 0

I have Datastore Class and I use this class to try GCM . I do not understand where the data is saved (registrations id) but I can retrive this after I restart my IDE (Eclipse)

Thanks friends

private static final DatastoreService datastore =
    DatastoreServiceFactory.getDatastoreService();

private Datastore() {
  throw new UnsupportedOperationException();
}

/**
 * Registers a device.
 *
 * @param regId device's registration id.
 */

public static void register(String regId) {
  logger.info("Registering " + regId);
  Transaction txn = datastore.beginTransaction();
  try {
    Entity entity = findDeviceByRegId(regId);
    if (entity != null) {
      logger.fine(regId + " is already registered; ignoring.");
      return;
    }
    entity = new Entity(DEVICE_TYPE);
    entity.setProperty(DEVICE_REG_ID_PROPERTY, regId);
    datastore.put(entity);
    txn.commit();
    } finally {
    if (txn.isActive()) {
      txn.rollback();
    }
  }
}

/**
 * Gets all registered devices.
 */

public static List<String> getDevices() {
  List<String> devices;
  Transaction txn = datastore.beginTransaction();
  try {
    Query query = new Query(DEVICE_TYPE);
    Iterable<Entity> entities =
        datastore.prepare(query).asIterable(DEFAULT_FETCH_OPTIONS);
    devices = new ArrayList<String>();
    for (Entity entity : entities) {
      String device = (String) entity.getProperty(DEVICE_REG_ID_PROPERTY);
      devices.add(device);
    }
    txn.commit();
  } finally {
    if (txn.isActive()) {
      txn.rollback();
    }
  }
  return devices;
}
  • 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-16T23:03:05+00:00Added an answer on June 16, 2026 at 11:03 pm

    The data is stored either in GAE datastore when you are in production servers, or in a local file when you are in local development environment ( https://appengine.google.com/ –> application –>Datastore Indexes).
    In any case, you can see what data is stored in your app from admin console. For the development environment, you can check at

    localhost:8888/_ah/admin (from your browser)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two data sets in google app engine datastore. class First_Set(db.Model): start_time =
I have 2 classes which get saved in the google datastore. class product which
I have a datastore model representing items in an ecommerce site: class Item(db.Model): CSIN
I have created a datastore on the google app engine but would like to
I have some problemas with Datastore. when i restart googleappengine all my data is
I have been coding classes like this: public class ReportViewModel { public string Status;
I have an entity like this: @Entity @XmlRootElement public class Article { @Id @GeneratedValue(strategy
I have a custom object that I would like to save in the datastore(not
Sorry if this is a simple question, but I just can't figure out what
I have this class: class Contract(db.Model): book_number = db.IntegerProperty(required = True) initial_page = db.IntegerProperty(required

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.