Android Google Maps InfoWindow not resizing properly - java

I have a custom info window set up for my marker with simple 9patch file for its background. It seems to be working perfectly but when I run the app on emulator (Nexus 6P) it is misaligned - left side of 9patch ends up being shorter then the right side. You can see what I am talking about on this picture:
As you can see on the photo, left size is larger and therefore info windows seems of center. This happens is emulator but on my Galaxy S6 everything appears normal. I am not sure if it is the emulator or pixel density problem.
I also don't think its problem with 9patch since in preview everything seems to be normal.
Also in XML layotu where I use the background, preview shows normally sized info window.

Related

Panel.image displays some images with the wrong orientation

We are working on Tensorflow to train a dataset of images.
To get images we record video using our phones and, using OpenCV in Python we extract each frame and save them as JPG images. I rotate some of them to portrait mode with the Photos App on Windows 10.
Then, we have our own annotation tool written in Java to label each item we see on the images. It return a CSV file for each object with their coordinates (in percentage).
However, when I ran the training yesterday, I noticed via the tensorboard interface that some were not annotated rightly (the ones I rotated with Photos)
Here is the image opened on Tensorboard, you can see that the can is very badly annotated.
It turns out that if I open this image with our Java software it is well annotated, but as you can see below, the image is horizontal (it doesn't take in account the rotation applied with Photos) :
If I open it with Paint, or the explorer it appears in portrait mode like in tensorboard.
An other fact, If I send the picture via Facebook, and download it again, it will appear in portrait mode on the Java tool as it would have been from the beginning.
I tried to rotate the image with Paint this time, and it appears correctly in the Java tool.
The code that displays the image in Java:
panel.image = New File(srcFile);
The code that saves video frame in Python:
cap = cv.VideoCapture(video_path)
while cap.isOpened():
ret, frame = cap.read()
if ret:
try:
cv.imwrite(output_img_path, frame)
except Exception:
pass
else:
break
cap.release()
Do you know why Java ignores the rotation applied via the Win10 Photos software, why it works via Paint ?
Is there a way to make Java take it in account because it would be very unpleasant to start again from scratch.
Thanking you in advance,
After noticing that rotating images with Paint instead of Photos was giving what we wanted, I found out what was wrong.
"If you’re using Windows 10, File Explorer and the default image viewer will properly obey the Exif Orientation tag, so photos that come from your smartphone or digital camera will be display properly. Google’s Android and Apple’s iOS both natively create photos with the Exif Orientation tag and support it." (source)
I used JPG autorotate to fix this.

Robovm black bars on top and bottom of 4-inch screens

I have installed robowm and created the sample app given on the offical website.
It works perfectly on emulator with screen size of 3.5 inch, but black bars occur on top and bottom of screen when I test it with 4 inch emulator or iPhone 5.
Seems like robovm is not supporting 4 inch screen size.
Does anyone know how to solve this problem?
RoboVM definitely supports the 4 inch screen. You just have to tell iOS that your app supports the larger screen. The way to do this is to provide a launch screen with the right name and dimensions. Put an image named Default-568h#2x.png with dimensions 640x1136 pixels in your resources/ folder in your RoboVM project and iOS will let your app use the full screen.

work on Samsung but blank screen on Nexus 7

Happy New Year,
I am developing my application by following This tutorial (using LibGdx, extents Game, with AbstractScreen, using Stage). However, currently I am experiencing a very funny issue. Everything display correct on my Samsung phone but not on my ASUS Nexus 7. Please see this link for the recorded video (MP4: ~800kb) of both devices. As you can see from the Samsung phone, you can see the “Fullmoon Inc.” splash screen (~25 secs). However, my nexus 7 display nothing at all even though I am sure that my application is running on my nexus 7 (sound played on certain timeframe). I tried to update my nexus 7, reset back to factory default, run on empty profile, still no luck at all. I am absolutely no idea what to do to fix it.
Another thing is that the loading bar on the loading screen (from 5secs – 23secs) is not display correctly. According to the following code, the loading bar (the yellow windows) should load in a smooth manner. However, as per what you can see on the video, it is not. Currently the bar only display "After" everything is loaded. Can anyone please lead me back to the correct path?
loadingPercent = Interpolation.linear.apply(loadingPercent, thisApps.assetManager.getProgress(), 0.1f);
this.loadingYellowBox.setWidth(-1040 + (int) (loadingPercent * 1040));
Thank you very much, and all comments are welcome.
I can answer the second part of question. AssetManager calculates percent based om number of asssets not on their size. Suppose you have huge texture atlas which is packed in one texture and several other small resources. Loading of the atlas takes 9 seconds and there are 4 other small resource which take 1 second to load.
So, see what happens. You have 20%-20%-20%-20%-20% when you expect 90%-10&.
If you want to more precise percentage you need to calculate percentage some other way.
Blank screen glitch is trickier. You need to check that Stage is properly initialized, aspect ratio is correct, resources are loaded correctly. You can download source code for libgdx, add it to your project and go through render method with debugger. If you find something suspicious there you can update this post or create a new one.
i finally figured out where the problem came from. the issue is that when i pack all my images, i set the Max page width and Max page height to 4086. i am guessing that somehow Nexus did not "really" load those images. problem solved when i reduced both Max page width and Max page height to 2048. anyway, i still appreciated helps from both #noone and #son-of-the-northern-darkness

Running Android app with web view on various devices with various physical sizes and resolutions

I've got Android application running in landscape mode on 10" tablet with 1280x800 px resolution. App contains web view including picture with 1280x720 px size, so it's kind of full screen web view.
If I run the very same application on HTC One X smartphone, which is 4.7", 720 x 1280 px, also in landscape mode, web view seems to display only part of the picture, much less as I would expect. It even looks like physical 1/4 of the original, top left quarter.
Does anybody have any experience of running same app on similar or even different resolutions with completely different physical screen sizes?
Any recommendations?
For instance, I would like to run this app also on 7" tablets, where the resolution is only 1024x600 px. Can I still do that without need of changing picture size?
That is just the behavior of a web view/web page in general. Unless you tell it to with JavaScript or css, it wont care how big your screen is and will display all the content at the exact pixel size specified. You can more than likely dynamically re-size the image with JavaScript or css.
This may be what you are looking for: How can I resize an image dynamically with CSS as the browser width/height changes?
According to this thread:
Android Webview initial zoom out
This is the right answer:
webview.getSettings().setLoadWithOverviewMode(true);
This will cause the webview to be zoomed out initially.
webview.getSettings().setUseWideViewPort(true);
The Webview will have a normal viewport (like desktop browser),
You can create separate stylesheets for each density.
http://developer.android.com/guide/webapps/targeting.html#DensityCSS
just to conclude this, all changes had to be done on portal side in html, js and css in order to display it correctly on various tablets.
Playing with settings of WebView element didn't help in this case.

OpenLayers map shows an extra tile on top of map

I have an Windows Phone 8 app made with PhoneGap framework to show a map of OpenLayers. Sometimes, although very rarely, I surf between views (jQuery Mobile is used) and suddenly when I am back on Map it shows an extra tile on the center of map. Tile is as wide as the map and starts some 20% before top and ends some 20% from bottom. It does disappear only when restarting the app.
I am trying to show up the phenomenon on dev mode of Google on browser, but so far no success.
No error is shown on console of wp8 sdk, I was testing it on device connected to visual studio.
What may cause that thing and could it be fixed somehow?
edit1: It may be possible I trigger a swipe event while moving the screen fast and that may make the Openlayers in error state.
First try:
I added this line:
-ms-scroll-chaining: chained;
to the div containing the map.
I used jQuery / HTML5 / gwt app for WP8 (Lumia 920) device: vertical css scroll fix to attach another things to same place, so I added it there.
UPDATE
This was not the fix, problem stayed. See below the correct answer:
The real answer:
https://github.com/openlayers/openlayers/issues/929 tells this is known issue of openlayers, that is already fixed in the latest version.
So, please update version of OpenLayers!

Categories

Resources