Android layout shadow - java

Hi I have been searchin for a solution on how I can make something like this possible. I am able to make two seperate views and make one grey an the other white but there isn't the same feel. Google uses a kind of shadowy effect in the white one. Is there a library that will allow me to do so?

you're probably talking about elevation, its a lollipop feature.
Material Design: Objects in 3D space - Elevation
there are many ways to replicate it on older versions of android, you could make your own png background image.
get creative with it, it's a lot of fun

Related

How To make Video Background transparent In ExoPlayer Android

I want to remove background color of video in exoplayer or make it transparent i.e if video background color is red then make it transparent and view behind exoplayer must be visible.
Note : I don't want to make changes in Exoplayer background only remove video background which is playing in ExoPlayer
I have made lots of search in google but unfortunate did't got right answer, Please let me know its possible or not and its possible using any other way please direct me.
Thanks in Advance
Exoplayer is not really designed to modify a video file like this while displaying it.
Given that the background may change from frame to frame, I suspect you may find it hard to find any solution that will be able to do this quickly enough on any regular Android device, as there will likely be quite a bit of video processing involved.
If your background is static, like the room behind the speaker in a Zoom or similar conference call, then it may be a bit easier and you could look at OpenCV background substitution techniques:
https://opencv24-python-tutorials.readthedocs.io/en/latest/py_tutorials/py_video/py_bg_subtraction/py_bg_subtraction.html
Most of the examples will be in Python so you will have to explore support in Android OpenCV, which is usually a subset and can be a little tricky to set up (check Q&A on SO for this). Android OpenCV also still uses Eclipse rather than Studio in the documentation at the time of writing, which is something to be aware of.
If you have the luxury of removing the background on the server side before you stream the video to the Android device then things will be easier and you should be able to find up to date example using Python and the OpenCV techniques linked above.
If you use case is a 'Greenscreen' background example, then ffmpeg can also provide you filters to change the background as you wish, including making it transparent. The documentation is here: https://ffmpeg.org/ffmpeg-filters.html#toc-chromakey
It includes an example to change the green screen to transparent in an image (png image in this example):
ffmpeg -i input.png -vf chromakey=green out.png

Android (or Android compatible Java) library to draw editable flow chart diagrams

I'm developing a flow chart drawing tool for Android and even though it has been a month I still couldn't find a good, reliable graphics library to help me develop this app.
Here are a few things I tried:
1-) Android views. Since a flowchart would naturally include lots and lots of shapes, this option wasn't satisfactory in terms of performance. Plus, I didn't even know how to draw arrows.
2-) Canvas. It was quite good when it comes to performance but canvas does nothing more than coloring pixels, so I can't go back to editing them after placing a shape on the screen.
3-) Now I'm working on Qt to see if I can achieve my goals and so far it seems as though it's very doable but using a cross-platform development software for only Android doesn't make a lot of sense.
4-) Libgdx and Unity are also options but using a game engine for such a lightweight app didn't seem like a very good idea to me.
Can you suggest me a good library or any other development tool?
There is https://github.com/mocircle/cidrawing library. Maybe useful for this type of task with link to https://github.com/Team-Blox/GraphView library.
Hope it helps.

Fixing Android apps size

Im just made my first little app on android.
I've been using the Android Studio for developing which is quite good but the problem is that the app I designed fits only a 5.5" display. On other devices its just very small or larger. I don't know how to make it autosize according to the size of the device.
Is there any way to fix it or is there any way to make different Apks for different mobiles (according to the display sizes)
PS: there isn't any picture in the app. Just writing and calculations. Kind of Calculator for beginners(ME). :)
If you dont have any images on your app, set your layouts and views width (when needed) to 'match_parent' instead of 'wrap_content' or a fixed size.
Set the parent layouts height to 'match_parent' and if you have a background that fits all the screen, set this too.
Check this for reference of LayoutParams values: http://developer.android.com/reference/android/view/ViewGroup.LayoutParams.html
If you want to add images Go to http://developer.android.com/guide/practices/screens_support.html and try to understand all the concepts of densities independence and supporting multiple devices.

Programming For Various Screen Sizes in Android

I'm using the Canvas and the SurfaceView. I've explicitly mentioned the coordinates for various objects and fonts on the screen. The app runs perfectly on Samsung Galaxy S Advance but the objects are out of scope on smaller screens such as that of Samsung Galaxy Fit or Pop. How do i make it compatible for all screen sizes and pixel densities.
Using dpis seems out of the question as I'm not using any xml layouts.
Thanks in advance.
I think you should get screen resolution at run time and set pixels according to that.
According to the developer guidelines it is discouraged to do so (work with explicit coordinates). Please refer to the android design guidelines for how to do it better. If you cannot avoid it, you'll need to take into account the screen size and density and compute your coordinates accordingly.

android - capture of the entire screen programatically

Is it possible to capture the entire screen from Android application code? I'm developing an application like VNC for Android platform.
Regards
I think that depends on what you are trying to capture. I'm sure you can use Moss's method to create a screenshot from your own application - that is, something you render yourself.
As I understand it however, capturing from other views, apps, etc. is designed to be impossible for security reasons. This is to avoid apps being able to take screen shots from other apps, which would make it easy to steal sensitive data.
yes it is. You just need to create a canvas and assign it a Bitmap, then draw to that canvas instead of the canvas you use in your onDraw method and save the bitmap on the SDcard for example.
Just to renind you that this method will work if you handle the drawing, so you should use a custom home screen for it to capture wether you want. (just get the default android home screen :D).
I don't have personal experience with it, but this open source project sounds like it might either solve your problem, or provide you clues as to which API to use:
http://sourceforge.net/projects/ashot/
Screen capturing tool for Android
handsets connected via USB to a
desktop/laptop. It is great for
fullscreen presentations, product
demos, automatic screen recording, or
just a single screenshot. Without
root.

Categories

Resources