Blackberry How to get the current home background uri? - java

I'd like to know how I can get the uri of the current background image of a blackberry.
I need this because I want to edit this picture and then set it as the home screens background again. The edit I want to make is to put text on the image.
So basically I want to perform these steps:
Get the uri of the current
background of the main screen.
Create a new bitmap based on the
background.
Add text to the bitmap
Save the new bitmap and set it as the home background
So, does anyone knows how to get the background uri of the home screen? (not the application background).

You can't get background image. HomeScreen class in the API lets you only to set the background image. To give you an idea, several applications that adds text to background was pushing users to select the background first. I recommend you to do so and after first run of your application, you can save the path.

Related

How to place comments on a full screen image?

I'm working on a native android application in java with Android Studio and I want to add comments on full screen images like this. This based upon a feature of "Figma" where you can place comments on prototypes.
I have already made a xml file that normally has an Imageview in full screen. So I probably need to draw a circle on the exact coordinates of the view where I click. So how can I achieve this in java code?
Figma example 1
Figma example 2
use draggable view and when user clicks it display dialog where they can enter a comment,
then save the position of the view and the comment to SQLite or wherever you want so the user can retrieve it again whenever they need it

How to set GIF as wallpaper and stop GIF animation after some time?

Is it possible to stop GIF animation and after some time start animation again? Let me explain you what exactly i am trying to do.
I want to set GIF file as wallpaper and 2 mins i want to stop the GIF animation. AND when i press the power button and unlock the device than again my GIF animation start and after 2 min it will stop.IS THIS THING IS POSSIBLE?
And what i have already DONE is i can set GIF file as wallpaper. but i cant find any way to stop that animation.So what i do is set another image as wallpaper but when i unlock the screen it will not set GIF wallpaper again and its only show old png image.
There is an app called ITTT (If this, then that). It allows you to set actions that are triggered by certain things. For example, to get the result you're looking for, you would set the action, change wallpaper to (image), with the trigger being "locking phone", and another action, change wallpaper to (GIF), wit the trigger being "unlocking phone).
The resulting effect would be that your wallpaper automatically switches between GIF and PNG when you lock/unlock your phone.

How to put camera sensor inside my Activity? [duplicate]

This question already has an answer here:
Custom camera android
(1 answer)
Closed 8 years ago.
There is an application made by another developer and I need to continue it. It has an activity with a button that calls the default camera app as an intent with startActivityForResult. It works ok when they take only one picture per app session. But now the client wants to be able to take various photos from different position of the place and then upload them all to the web server. So I need another way to do that, faster than opening the camera app for every picture.
For this I wish to load the camera directly in my activity, place a 'shoot' button, a label with the number of pictures taken, an imageView with the last image saved, and a button to finish. As an example I show you this printed screen from Internet.
The idea is to save a picture on every button click, and save the file names in an array.
How can I use the camera this way and control it with a custom button?
I also try to control the camera and I am using this link
I hope it is useful for you. It has helped me to fix several bugs

Take picture automatically with MediaStore Intent

What I am looking to do is to capture an image on a button click, without requesting any other input from the user.
At the moment I'm using a MediaStore.ACTION_IMAGE_CAPTURE intent inside my activity, which is called when pressing a button on a widget. At the moment this opens the camera preview allowing me to take a picture.
That's all working great, however what I'm looking to do is when the user presses the button on the widget, take the picture straight away and display a preview of the captured image. So it essentially snaps the picture automatically, without the need for the user to press anything else.
I tried using the Camera API directly, using a SurfaceView class to capture the image and call the PictureCallback etc, this worked how I want it to, however the quality of the images was very low and I couldn't figure out how to change it.
So I guess I'm looking for an answer to either of those two problems, or both if anyone knows them.
Firstly, is there anyway, using something similar to a MediaStore.ACTION_IMAGE_CAPTURE intent to snap the image automatically without requesting the user to take the picture.
Or secondly, how can I increase the quality and resolution of an image captured using the Camera API directly (camera.takePicture(shutterCallback, rawCallback, jpegCallback); and all that business).
Any help would be much appreciated.
Did you try autoFocus?

How do I insert multiple image in Edit Text in android

I am trying to insert multiple images in one editText. I have used following code to attach image to EditText
txt = (EditText)findViewById(R.id.text);
Bitmap bitmap = BitmapFactory.decodeFile(attach);
Drawable drawable = new BitmapDrawable(bitmap);
txt.setBackgroundDrawable(drawable);
But the problem is it only attach one file and show, If i used array then only the last image is only show. at any how it only shows one Image. Is there any way to show multiple images in one Editbox. Thanks in advance.
Because you can only have one background.... if you want more then there is a layer Drawable which you can use and also you can put the button in a frame layout and add a couple of imageViews below/over it for the rest of the images.
But the best solution will probably be instead of having a couple of bitmaps to just make a single one in Photoshop or equivalent photo editing app and place that one.
According to docs: http://developer.android.com/reference/android/view/View.html#setBackgroundDrawable(android.graphics.drawable.Drawable)
You are not able to provide more than one Drawable item in argument
And I don't know if you understand what is .setBackgroundDrawable(d) method purpose, but it is not meant to be used for displaying images inside text but to set Background of EditText View.
So you're not inserting images in EditText but setting its background,
look for some Rich Text Edit components usable for Android
such as http://code.google.com/p/android-richtexteditor/
or others..
You can probably use a LayerDrawable with the constructor LayerDrawable(Drawable[] layers) to chain together several images and display them as an EditText's background, though as Marek said, I suspect you're looking for something other than setting images in the background.

Categories