I use for javaEE project Spring, and I use bean injection with @Servive annotation. Now I'm going to make android's projects and I'd like to use the similar structure for my service bean. Is it a way to do it?
i.e.
public interface GlobalService {
final static String PACKAGE_ACTIVITY = "net.....activity.";
/**
* start an activity only by the activity name
* the intent is declared inside
* @param activityName
* @return True if the activity Start else False
*/
public boolean openActivity(String activityName);
}
then I have a class that implements interface
@Service("GlobalService")
public class GlobalServiceImpl implements GlobalService{
public boolean openActivity(String activityName) {
//some code ....
}
}
finally I declare into my class
@Autowired
private GlobalService globalService;