DEV Community

Cover image for How do I take a screenshot inside mobile app for iOS and Android?
Brenton House
Brenton House

Posted on

How do I take a screenshot inside mobile app for iOS and Android?

Dear Geek,

I want to allow users to take a screenshot of app when submitting a troubleshooting ticket. My app is built using the Titanium Mobile SDK and runs on iOS and Android. Can you show my how to do this?
 

  —   SCREENSHOTS WANTED

Dear Screenshots,

Including a screenshot with user reported incidents can be a great way to add context for development teams! With Titanium Mobile SDK, it is super easy to take a screenshot and get back an image that you can then upload or email as an attachment.

Titanium code to capture screenshot and save/display


// Take screenshot
Ti.Media.takeScreenshot( e => {

    // the "e.media" property contains the screenshot image

    // You can also display the image on the screen
    $.imageView.image = e.media;

    // Or save the image to photo gallery
    Ti.Media.saveToPhotoGallery(e.media);
});

Enter fullscreen mode Exit fullscreen mode

You can find more information about capturing screenshots with Titanium Native mobile apps on the Axway Titanium API Documentation page here.

About Brenton House
With 25 years of experience in the development world, Brenton House leads Developer Relations for Axway's API and mobile products, He has worked closely with many clients across various industries including broadcasting, advertising, retail, financial services, transportation, publishing, supply chain, and non-profits. Brenton's passion for everything API and mobile combined with his strategy and design experience, has enabled him to help developers create captivating products that inspire and delight audiences.

Ask-a-Geek-API-Mobile-Questions-Solved

Ask-a-Geek questions are answered by Brenton House, an API and Mobile geek who has been doing dev work for 25+ years.

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.