From your description I would think that you just need to call an existing function with varying parameters, getting those parameters from the network. If so, there are many ways to do that but the simplest one is probably to define each parameter as a global variable and assign it a default value (so the program will not break if the variable is not set).
Yes, you are right spatula, it is what I am doing.
Then use the network connection to get the parameters, using for example a name:value format (e.g. alarm-duration:10), adding start and stop delimiters for further safety (e.g. alarm-duration:10). Decide whether the Arduino will request the parameters or just wait for them to arrive.
And yes again, you read my mind. I am using start and stop delimiters (<,>), it is already working to do other functions, but the problem is not how to get the parameters because I already did it, I need to find out a way to create alarms based on parameters sent from android's app.
I will explain exactly what I need.
I have created an android app to control my home automation system, in this app there is an option to program things to turn on/off at any date/time I want, but I have a lot of things in my house that I can turn on/off, and I want to do something in the arduino that enables me to turn on/off only one or all things that I want to.
I can't think how I can do that at the arduino side.
As I said ,I am using the TimeAlarms library and there is one thing that I do not know but I would like to. For example, if i call a function that calls the function "Alarm.alarmRepeat(20,02,00, MorningAlarm);" when I pass some parameters, and then calls the function again "Alarm.alarmRepeat(6,00,00, MorningAlarm);" when I pass another parameters, the function will create two different alarms or one overwrites the other ?
If every time I call the alarm function, one alarm is created, so I think it will be less hard, because I will need only one function to create all the alarms, but I will still need to send back to android the ID of each alarm that was created, case I want to cancel one of them.
If I am right, the difficult part will be to say to arduino what thing I want to turn on/off with only one function to do this considering that I have a lot of things that can be on or off.
That's why i asked about creating functions dynamically, if it were possible would be easy to do all that stuff, the program would create as many functions as I would want to.
Any ideas ??