From the course: Android App Development: Enterprise Integration

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Check restrictions: URL

Check restrictions: URL - Android Tutorial

From the course: Android App Development: Enterprise Integration

Start my 1-month free trial

Check restrictions: URL

- Let's open up the image activity in our example project. Just like before, we should start by creating a Restrictions Manager object. This will be called My Restrictions Manager. And we should define it in our On Create method by calling Get Systems Service with the context of Restrictions Service. Next, we should be checking the app restrictions in the On Presume method. Let's create a bundle called Application Restrictions, and fill it by using My Restrictions Manager dot Get Application Restrictions. Like before, we should check that the bundle has content by making sure that its size is greater than zero. Once we are sure that our bundle has content, we should set our New Image URL by calling Application Restrictions dot Get String. Using the Image URL key that we defined earlier, which is Image URL. In this instance, we should make sure that we check that this URL is valid, using If URL Util dot Is Valid URL, and giving it our Image URL. Now, let's move our call to set the…

Contents