0

I tried to use active android, i have a doubt about how could i achieve a auto-increment field in a table?

In their documentation they have provided a code like this

Item item = new Item();
item.remoteId = 1;
item.category = restaurants;
item.name = "Outback Steakhouse";
item.save();

Can we make the remoteId field auto-increment?

Aditya
  • 2,876
  • 4
  • 34
  • 30
George Thomas
  • 4,566
  • 5
  • 30
  • 65

1 Answers1

1

In sqlite you should use Autoincrement tag in create table: http://www.sqlite.org/autoinc.html

In other cases use methods like getPrev(), getNext(), etc.

QArea
  • 4,955
  • 1
  • 12
  • 22
  • https://github.com/thecodepath/android_guides/wiki/ActiveAndroid-Guide this is the library but here not mentioned how to autoincrement. – luttu android Sep 29 '14 at 17:15
  • @luttuandroid please provide the code where you want use items from this libs – QArea Oct 02 '14 at 12:37