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

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

brentonhouse profile image Brenton House ・2 min read

Ask-a-Geek: Answers to Frequently asked API and Mobile Questions (6 Part Series)

1) How do I add a custom font to my mobile app for iOS and Android? [SOLVED] 2) What are the best practices for architecting API authentication? 3 ... 4 3) API-First, Mobile-First, Design-First... How do I know where to start?? 4) How do I take a screenshot inside mobile app for iOS and Android? 5) How can my Titanium iOS app detect that a screenshot has been taken? 6) How do I add the Star Wars intro to my iOS and Android mobile apps?

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);
});

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.

Ask-a-Geek: Answers to Frequently asked API and Mobile Questions (6 Part Series)

1) How do I add a custom font to my mobile app for iOS and Android? [SOLVED] 2) What are the best practices for architecting API authentication? 3 ... 4 3) API-First, Mobile-First, Design-First... How do I know where to start?? 4) How do I take a screenshot inside mobile app for iOS and Android? 5) How can my Titanium iOS app detect that a screenshot has been taken? 6) How do I add the Star Wars intro to my iOS and Android mobile apps?

Posted on Apr 23 by:

brentonhouse profile

Brenton House

@brentonhouse

API and Mobile Strategist with 25+ years in dev community. Head #DevRel Geek at Axway and host of Breaking the Build YouTube series.

Discussion

markdown guide
 
Sloan, the sloth mascot Comment marked as low quality/non-constructive by the community View code of conduct

Hello, I'm an IOS developer. Recently, when using swift to develop applications, I found that there are few caches written by pure swift. So I wrote a cache -- swiftlycache, a lightweight general-purpose IOS cache library using swift 5. If you are using swift for development, if you also need to use cache, maybe you can try swiftlycache, maybe you will like it, If you like, you can also introduce it to your friends. Thank you
github.com/hlc0000/SwiftlyCache