How do i save input data for later use on Android devices?

Hi people,
i am pretty new to c# and programming overall. I need to create an Android App for an exhibition we´ll be attending soon. When the visitor got all his infos etc. i want to make him enter his name and E-mail and save it for later use (like sending a newsletter etc.). By now i made one version where i save it to our mySQL Sever and one where i save it to an external txt file via Streamwriter. Both works fine on my PC but as soon as i export it to an Android device, the button that saved the data AND chages the scene just does not do ANYTHING. It does not have to be mySQL or saving to txt. I just need to save the data in any way at all.

If it helps, please see the example of the code i have so far for MySQL:

private const string CONNECTION = “SERVER=ourIP;PORT=ourPort;UID=myName;PASSWORD=myPW;DATABASE=exhibition;”;

public void AddSubscriber(){

	MySqlConnection con = new MySqlConnection(CONNECTION);
	Debug.Log("Connecting to database...", this);
	try 
	{
		con.Open();
	} 
	catch(Exception _e) 
	{
	Debug.LogError("Failed to connect to database(" + _e.GetType().Name + ")!

" + _e.Message, this);
return;

	}
	Debug.Log("Connected!");

	try 
	{
		MySqlCommand cmd = new MySqlCommand("INSERT INTO teilnehmer (EMail, Name) VALUES('" + m_emailInput + "', '" + m_nameInput + "')", con);
		cmd.Prepare();
		cmd.ExecuteNonQuery();
		cmd.Dispose();
	}
	catch(Exception _e) 
	{
		Debug.LogError("Failed to write subscriber to database(" + _e.GetType().Name + ")!

" + _e.Message, this);
return;
}
Debug.Log(“Successfully wrote subscriber to database!”, this);
con.Close();
con.Dispose();
}

and for Streamwriter:

public void Write(){

using (StreamWriter writer = new StreamWriter (@"Teilnehmer.txt", true)) {
		writer.WriteLine (m_nameInput + ": " + m_emailInput);
		writer.Flush ();
			}
	}

Any help is greatly appreciated since i am kinda running out of time :wink:

You can use filestream, It will work lyk a charm.

FileStream fs=new FileStream(filepath,FileMode.OpenOrCreate,FileAccess.ReadWrite); fs.Write (System.Text.Encoding.UTF8.GetBytes(datatosave), 0, System.Text.Encoding.UTF8.GetByteCount(datatosave));

Thanks guys. Took me a day to get to know the Playerprefs and make it work but now it does. If anyone bumps into that problem:

void PPref()
{

	participants += (m_nameInput + ": " + m_emailInput + "

");
PlayerPrefs.SetString (“Teilnehmer”, participants);

}

that will save the value participants in PlayerPrefs “Teilnehmer” and store the values (in my case email and name input) in participants.
Then call it in the start to retrieve the value so it is still there when you start up the app again.

private void Start(){

	participants = PlayerPrefs.GetString ("Teilnehmer");

}

Hope i am not talking rubbish right now but for me this worked :stuck_out_tongue:
Thanks a whole lot guys :wink: