Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

How would it be possible to test for the presence of the ODK at run time? Currently I took this approach:

private activityDelegate delegate;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //Need to test for the presence of the ouya ODK here
    {
        delegate = new OuyaDelegate(savedInstanceState);
    }
}

But maybe there is a better way of doing this than in the main activity?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

The standard way of doing this is to pick a class that you know should exist and then see whether it does:

try{
    Class.forName("tv.ouya.console.api.OuyaFacade");
} catch (ClassNotFoundException e){
    Log.e(TAG, "No ODK Found!");
}
share|improve this answer
    
Great that did it! –  Coyote Feb 3 '13 at 11:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.