Putting info on BlackBerry homescreen - blackberry

We're developing some application and want to display some information on the device homescreen like Weather Plus application does.
Could you tell me how i can do the same thing? Thank you!

From what I've seen in the Weather Plus video demos, the app doesn't (or can't) paint on the current background image, but you can choose an image to be the homescreen background with all the weather info painted on it. It also doesn't need a custom theme, so I'm pretty sure they just use the HomeScreen.setBackgroundImage() method.
As far as the image generating is concerned, my best bet would be opening the background image picked by the user in a Bitmap object, passing it to a new Graphics object to do all the necessary rendering and creating a new .png file using the encode(Bitmap bitmap) method of PNGEncodedImage.
If you wanted the homescreen image to be for example animated you might want to try the Blackberry Theme Studio, but I don't think it offers the amount of interactivity (retrieving data, loading images) you are looking for, at least for now.

Related

Prevent manual screenshot in IOS Objective-C

On iOS, my requirement is disallow user to take manual screenshot from my application, either disallow or blur the captured screenshot. How?
The only solution is to simulate the iOS controls you have in your View using DRM'ed videos.
For each widget you need to create a video subclass that renders the widget, and apply DRM to the video.
You can try to do it yourself, or use a commercial solution such as the following:
https://screenshieldkit.com
It is possible but I don't recommend it because of the room for error. It was easier to do in the past, in iOS13 you will have to do it like this:
You will have to ask for the user's permission to read and edit their photo library, then you have a listener which is checking the number of photos in their library while they are using your app, if that number changes, they have just taken a screenshot (unless you allow other things in your app like tap and hold to save image, etc). When this happens, read said photo and apply a blur, then delete the photo from their library and save the blurred photos.
Warning: There are times where a user may get a photo while using your app that is not a screenshot (e.g. they received an airdrop) and you will now be tampering with their photos, which is very bad. To prevent this you may need to use key value pixel encoding on your screen at all times, for example the first 3 pixels of the screen are 3 very specific RGB values, that way if a new photo is detected and the first 3 pixels are those exact RGB values you know it's a screenshot of your app and not just another photo that was somehow saved while the user was using the app.
There isn't any regular solution to your problem!
You can do some tricks such as if you force the user to have their finger on the screen for the image to show then I don't think they can create screenshots. Because as soon as you press the home+lock keys to actually take the screenshot, the screen seems to behave as if there are no fingers touching it.
BUT what if the user takes a screenshot by AssistiveTouch?!
OR what do you want to do if user records screen and taking screenshot from the video?
I think it's better to change your strategy for example notify the owner of picture for taking screen shot by another one (like SnappChat)!

How to automatically adjust a photo (ie. brighten, contrast) on iOS?

My iOS app (objective-C) handles photos. I'd like it to be able offer the user a way to automatically "adjust" an image, like how iOS itself does in the Photos app (little magic-wand icon), or how facebook does it. This basically means auto-brightness and auto-contrast adjustment.
So far i've found "filtrr" (more concerned with adding color it seems), and OpenCV (uhh, feels like using a nuclear missile to swat a fly with). Any other hints? Is there some library or a way of even doing this natively in iOS?
thx!
Look into Core Image for info on filters and how to apply them. Apple's programming guide is a good place to start.
Once you're up and running with Core Image, see the autoAdjustmentFilters method for getting a set of filters that's preconfigured for "one touch enhance" kinds of usage.

how to embed flash/SWF animation in startup screen in IOS app?

i wanna to embed an animated logo in the application startup screen, this logo is already done in 2 formats of files SWF and Flash, my question is about how to embed these files directly in the application startup screen, such that the animated logo appears directly on the startup screen.
Appreciate your concern,
Thanks in advance
This is not possible. iOS does not support Flash.
Update: to follow up with a possible solution, since your Flash is just an animation, perhaps you can just render it to a video and use that instead?
First off, your start-up screen is a static image ("Default.png")... so you can't do animated stuff there.
Once your app fully starts up and the static image disappears, then you could have something animated.
In a practical sense, it can not be Flash or a SWF though (Flash files are SWF files, by the way). One can build Flash-based apps for iOS using Adobe AIR, but that's a full blown environment and IDE separate from Xcode.
It'd be smarter to do your start-up animation using CoreAnimation, HTML5 or some other fine animating framework (Unity, Cocos2d or whatever).
Or a separate video file (in which case the user has minimal interaction possibilities). But +1 to Darren for suggesting this answer faster than I could think of it.
If you are planning to publish your app on the AppStore, then what you are trying to do is Impossible !
Your best option is to create the animation you want using Core animation or you can simply convert that animation to a video and play it once your app is loaded.

Getting yellow UIBarButtonItem button like Photos app?

I'm currently working on an UI to crop an image inside my app, and I'd like it to feel as native as possible. I looked to the iPad's built in Photos app for some ideas, and noticed that when you crop an image, instead of a blue "Done" button, it has a yellow tinted button that has "Crop" on it, like so:
Does anyone know how to replicate this? I recall that the UIKit framework had a bunch of artwork stored inside of it in some custom file format and an iOS app existed that was able to read this and save you the individual PNGs, but I do not remember what this app is called. Conveniently enough for me, the thing I remember is that this yellow button graphic was among those contained. Anyone got any ideas how I can replicate the button nevertheless?
(Although if anyone knows that utility, that'd be great.)
Try this:http://www.raywenderlich.com/4344/user-interface-customization-in-ios-5

Add styles to dynamically downloaded images in iOS app

My question is: Since I have an app that downloads images from TMDB (the movie database) and I can't edit them in Photoshop before adding them to my application I was wondering if there was a way to add effects. Like a nice drop shadow and a 1 pix border to my images dynamically as they are downloaded or referenced from within application? (during development)
I can't seem to find a way to do this. I'm probably looking in the wrong place though.
Any help?
You can easily do all that using Quartz.

Resources