I am trying to integrate my project with PESDK. I need to get image that is currently in the editor. I found that PESDK has R.id.editorImageView. This is object of EditorPreview class which isn't an extension of ImageView. So I didn't understand how to extract the image. Because of word Preview I suppose that PESDK do not apply immediately all changes to the image and in the end after pressing default AcceptButton of PESDK it runs final calculations and saves this image.
Is there any way that I can emulate this action? I just need to get Bitmap in the memory without saving it.
If there is no such way then I think the one possible solution is to call onClick of default AcceptButton and notify my code that it was pressed myButton, not AcceptButton. Then read saved image, process it and then delete file. I'm quite new in Android and if you know how to do this notification (that it was myButton pressed) then please share your knowledge.
Thank you for any help or advice!
Related
I have an application in java swing and geotools. I have displayed a map image and trying to add images as layers to it. When it adds layer it blinks and after some time at the call to addLayer function map image and other few layers disappear for some time. How to stop this? I am loging all the information at the same time in SQLite and then to my own customised file.
I have stopped trying refreshing all after addLayer function call. The all process should work smoothly without blinking and disappearing. Please Help.
The gt-swing module is really only intended for simple demonstrations. If you intend to use it in production you should add in off screen buffering to allow "fast" refreshes of the map without rereading all the displayed data.
We have a Barcode scanner, to scan 3 types of barcodes (CODE93, QR, Datamatrix).
The scanned data from Barcode scanner gets placed in the cursor point.
For displaying only the QR code data, even if other code gets scanned into, we need to analyse the received data in the cursor point.
We have found & tried to automate click event, but weren't able to automate the same.
Can someone help us with a program to solve the same?
There is a TextWatcher listener available in the sdk to get the value of an edittext whenever it's value changes. There you can get the changed value and perform any analysis needed. Automating a click event doesn't make any sense. Whatever code you have written inside onclick listener can be called anywhere else if you have put it inside a method of your own. Still if you want to know you can look into this thread Can I click a button programmatically for a predefined intent?
button.performClick()
Guys i am developing Camera Application and this is my first android Application.
below i am Adding My App Screenshot for what i want.
First View :
Here , after Clicking on a Top-Right Corner Filter icon i want a below View.
Second View :
i don't know how can i get this type of a view. also how can i design this type of view into XML parts.
and i read more articles like how to Open a Multiple Surface-view Preview onto single screen but i did not get any much appreciate solution.
and Finally after selecting any of the Filter Preview i want a above Image type View.
means Selected Filter's is Preview apply onto Camera [Surfaceview Preview].
Please provide any type of Material link example.etc
guys please help me.any type of help will be appreciated..):
Thanks in advance
From the images, it's from a app called Geak Camera. Actually, I developed this app, and I used the GLSurfaceView not the surfaceview. And the app is not maintained now because I left that company. And I updated that app called "U camera".The scale animation was improved in "U camera".
All these manipulations can be performed with OpenCV. Download their basic Android example, and you can add your logic to onCameraFrame() callback.
I am writing on an android app, and my current task is to load an image from a URL and display it in an ImageView.
What i did so far: I managed to download the image and save it as a bitmap. Now when i want to add it to an intent via
intentRecord.putExtra("Data",(DownloadDataImage) result);
where result is my bitmap image, i get an error because a bitmap is not serializable, and .putExtra() requires a serializable input.
Do you guys know any workaround for me? I don't know how to circumvent my problem in an appropriate way.
Is there a way of adding an image to an imageView without using a Bitmap, and instead using another serializable type? Or is there a smooth way of making my bitmap serializable? I know this is possible, but i am not quite sure how to do this.
Thx a lot for your help!
I suggest you to try picasso to do the hard work of handling/caching images.
Once you have the jar in your workspace, you just need one line of code
Picasso.with(context).load(image_url).into(imageView);
Because there is an upper bound to the size of what can be put in Intent extras, you should look into another way to get the image into your ImageView.
At a very high level the steps of this could be:
IntentService downloads image and stores it somewhere that's globally accessible (in-memory cache or on disk).
After download has completed and service has saved the image somewhere, it sends a broadcast to let BroadcastReceivers in your app know that the image is now available.
A BroadcastReceiver in the activity or fragment that is hosting your ImageView would then retrieve the image from the stored location and place it inside the ImageView (if from disk then remember to do this retrieval off the main thread).
As other answerers have mentioned, there are frameworks that do a lot of this boilerplate work. Picasso, as suggested by droidx, is a great solution that's easy to implement and would probably be your best bet.
you can use external library like Universal Image Loader and you won't have to worry about cache management and other things...
I'm currently working on my first android project, which is to modify an existing sample program ("Tic Tac Toe" game). I'm going through the tutorials on the official website, but looking at the sample code I don't think I'll be able to figure everything out on my own in the time I have.
The modifications include being able to select a custom background, setting up a scoring system, and implementing a timed "blitz" mode. My basic questions are:
In which subfolder would the code that sets the background color/image for the game be?
Is there a way to create an Intent function that opens up a file search window to allow a user to select this custom background image?
I'd like to start here, I'm sure I'll have more questions as I go along. As always, any help is appreciated. (By the way, the code from the game is from the standard sample problems that come installed with the Android SDK for Eclipse).
Update 1:
So far I found this in a class called GameView:
mDrawableBg = getResources().getDrawable(R.drawable.lib_bg);
setBackgroundDrawable(mDrawableBg);
mDrawableBg is a Drawable object, I'm not sure what this part is refrencing:
R.drawable.lib_bg
What would be the proper way to modify the background in this piece of the code?
Update 2:
Here's where I'm at:
I have the getDrawable function taking another function as an argument:
mDrawableBg = getResources().getDrawable(getImage());
getImage() is suppose to return a integer referencing the selected image, here is the code (so far) for that function:
public int getImage(){
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
startActivityForResult(intent, 10);
}
This is suppose to open the gallery and let the user select an image, I'm not sure how to return a reference ID to that selected image though. Also, the startActivityForResult function is not working properly, I don't think I'm using the Activity class properly.
The background is probably defined as either a drawable (in /res/drawable-*) or a color value (in /res/values/colors.xml or something like that). It will be referenced in one of the layout files in /res/layout. The layout file will be referenced by one of the activity classes in the Java source folders.
You can declare in code an array of drawable resource IDs and use that to dynamically generate a dialog and/or activity. The HorizontalScrollView widget might be useful for this. If you start a selection activity with an intent, use startActivityForResult instead of startActivity. You can then set the background of your top view using setBackgroundResource().