You can get the id and user name using following methods.
User user = b.getUser()
--> Return the user associated with the status.
then using user.getId()
and user.getName()
you can get the id and user name.
try {
ResponseList<Status> a = twitter.getHomeTimeline(new Paging(1,1000));
for (Status b: a){
long userId = b.getUser().getId();// user Id
String userName = b.getUser().getName(); // user name
String tweetText = b.getText(); // tweet
System.out.println(userId+" "+userName+" "+tweetText);
}
}
For more info you can refer following links: