Nagri
Nagri

Reputation: 3136

Want to store two variables permanently for an App in mobile OS

I am trying to develop an App in Titanium Appcelerator all I need in that app is that it should always run in the background and collect current GPS coordinates and send it to a server. All I want the App to permanently remember is IP and PORT Number of the server. If the mobile is switched off and then on again IP and Port should be there. I think For this two variables only I should not use a Database. Is their any Other way to store IP and Port Number permanently other than using a database ?
Thank you

Upvotes: 3

Views: 440

Answers (2)

MRT
MRT

Reputation: 1610

You can Try :-

// Set one time. this is work just like Database

Titanium.App.Properties.setString("ip",<value>);

// Get any where

Titanium.App.Properties.getString("ip","value");

Upvotes: 10

Gautham
Gautham

Reputation: 3538

You can use SharedPreferences for storing them.

Upvotes: 0

Related Questions