Reputation: 917
I have facebook ids of all my friends.So I just want to post (message and image)on their wall.
IS it possible to do this?
I posted on my wall by using the following code
String res= UrltoValue.getValuefromUrl("https://graph.facebook.com/"+Login.facebookid+"/feed?access_token="+accesstoken+"&method="+"post"+"&message="+strFullMessage.replaceAll(" ", "%20")+"&source="+imageUrl);
Can I use loop to post on multiple friends wall?
I read that doing this is a spam. Are there any apps doing this kind of requirement?
please help
Thanks
Upvotes: 2
Views: 379
Reputation: 9217
Here is a sample code for creating delay
first create a counter variable at class level
public int counter = 0;
then use this code to create a repeatable counter
final int postCount = 100;
new Timer().schedule(new TimerTask() {
@Override
public void run() {
//Send message here ;
counter +=1;
if(counter>=postCount){
cancel();//stops the timer
}
}
}, 1000,3000);
the first parameter (1000) is the start delay (in ms)of timer and the second (3000) parameter is used to set subsequent delay between each repeat run actions.
Upvotes: 2