Click here to Skip to main content
15,884,388 members
Home / Discussions / Android
   

Android

 
QuestionAnimated ProgressBar in Xamarin Android in C# Pin
Tirumaleswara Reddy.K5-Jun-15 0:56
Tirumaleswara Reddy.K5-Jun-15 0:56 
AnswerRe: Animated ProgressBar in Xamarin Android in C# Pin
Richard MacCutchan5-Jun-15 2:37
mveRichard MacCutchan5-Jun-15 2:37 
QuestionSaving xml date in sql lite Pin
Member 117396203-Jun-15 9:11
Member 117396203-Jun-15 9:11 
AnswerRe: Saving xml date in sql lite Pin
Sascha Lefèvre3-Jun-15 9:38
professionalSascha Lefèvre3-Jun-15 9:38 
GeneralRe: Saving xml date in sql lite Pin
Member 117396203-Jun-15 18:59
Member 117396203-Jun-15 18:59 
GeneralRe: Saving xml date in sql lite Pin
Sascha Lefèvre3-Jun-15 19:37
professionalSascha Lefèvre3-Jun-15 19:37 
AnswerRe: Saving xml date in sql lite Pin
Richard MacCutchan3-Jun-15 21:45
mveRichard MacCutchan3-Jun-15 21:45 
AnswerRe: Saving xml date in sql lite Pin
Dadecki17-Jun-15 22:50
Dadecki17-Jun-15 22:50 
Hello,

I will try to show you the possibility to save the data with SQLite in Android application:

Firstly add import:

import android.database.sqlite.SQLiteDatabase;


1) Declare your database value in your Activity class:

private SQLiteDatabase _yourDBname;


2) Also declare name of the table in you database in Activity class:

private String YourTableForXml = "XMLtable";


3) In your Activity class in onCreate method initialize earlier declared database:

@Override
    protected void onCreate(Bundle savedInstanceState)
{

_yourDBname=YourActivityName.this.openOrCreateDatabase("NameofYourDB", Context.MODE_PRIVATE, null);

};


4) Now you must prepare your table structure (in onCreate method too):

_eSubSQLliteDB.execSQL("DROP TABLE IF EXISTS '" + YourTableForXml + "'");
_eSubSQLliteDB.execSQL("CREATE TABLE IF NOT EXISTS " + YourTableForXml + " (Id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, xmlColumn VARCHAR);");



5) Now you are ready to insert some xml to your table. Note that xml is just normal String value:

String sampleXML =
"
XML
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>

"

ContentValues  insertValues = new ContentValues();

insertValues.put("XmlColumn", sampleXML);

_yourDBname.insert(YourTableForXml, null, insertValues);



Hope this will help you.
QuestionHow to be notified when user copy some text in any application ? Pin
MohsenSaleh3-Jun-15 2:53
MohsenSaleh3-Jun-15 2:53 
AnswerRe: How to be notified when user copy some text in any application ? Pin
Richard MacCutchan3-Jun-15 5:22
mveRichard MacCutchan3-Jun-15 5:22 
Questionandroid Pin
chrisny26-May-15 23:58
chrisny26-May-15 23:58 
AnswerRe: android Pin
User 171649227-May-15 0:23
professionalUser 171649227-May-15 0:23 
AnswerRe: android Pin
Richard MacCutchan27-May-15 1:15
mveRichard MacCutchan27-May-15 1:15 
AnswerRe: android Pin
Member 1052365028-May-15 6:31
Member 1052365028-May-15 6:31 
AnswerRe: android Pin
Dadecki17-Jun-15 22:54
Dadecki17-Jun-15 22:54 
Questionhow to point in google map using address..? Pin
Member 1172141526-May-15 18:57
Member 1172141526-May-15 18:57 
QuestionRe: how to point in google map using address..? Pin
Richard MacCutchan26-May-15 22:00
mveRichard MacCutchan26-May-15 22:00 
AnswerRe: how to point in google map using address..? Pin
David Crow27-May-15 2:55
David Crow27-May-15 2:55 
QuestionProblem with java and Android Pin
Member 1172109726-May-15 14:59
Member 1172109726-May-15 14:59 
SuggestionRe: Problem with java and Android Pin
Richard MacCutchan26-May-15 21:58
mveRichard MacCutchan26-May-15 21:58 
GeneralRe: Problem with java and Android Pin
Member 1172109727-May-15 15:56
Member 1172109727-May-15 15:56 
GeneralRe: Problem with java and Android Pin
David Crow28-May-15 4:20
David Crow28-May-15 4:20 
QuestionHow can I export my Database Information in a file Pin
Jamil.Chowdhury24-May-15 6:46
Jamil.Chowdhury24-May-15 6:46 
QuestionRe: How can I export my Database Information in a file Pin
David Crow26-May-15 7:25
David Crow26-May-15 7:25 
QuestionWhat's the real meaning of a widget? Pin
CRobert45623-May-15 9:46
CRobert45623-May-15 9:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.