How to show a stock panorama activity with UI elements overlayed? - android

I am successfully showing a spherical image using the Google Panorama API
I am using the same code as most tutorials do:
#Override
public void onConnected(Bundle bundle){
Panorama.PanoramaApi.loadPanoramaInfo(GOOGLE_CLIENT,Uri.parse(url)).setResultCallback(
new ResultCallback<PanoramaApi.PanoramaResult>(){
#Override
public void onResult(PanoramaApi.PanoramaResult result){
if (result.getStatus().isSuccess()){
Intent intent = result.getViewerIntent();
if (intent != null){
startActivity(intent);
}
}
}
});
}
Actually, I do not only have one sphere but around 5. I would like to be able to switch between the images clicking on menu items overlayed over the images.
Since the actual activity showing the sphere is not defined by me but started through an intent received in the success callback I have no idea how I can achieve this and the API does not seem to offer much more possibilities.
I guess I can not even show a dialog on top of the sphere.
Does anybody have any ideas for me? I'd appreciate it a lot
Note: This question purposely is phrased very similarly to this SO post.

Solution: Switch to the more recent Google API – Google VR – with which it is possible to embed spherical 360° images in a view instead of starting an activity through an intent, which one has no control of.
Note: The API is still labeled experimental but being part of the VR API this looks like the library being actively developed.
Another advantage: This is open source while the older Google Panorama API is part of google play services, which is not.
PS: Before I looked into these libraries I tested PanoramaGL and OpenPanodroid. Both libraries are not maintained for years and it was no big suprise the results could not keep up with the Google libraries.

Related

Show HERE Maps Marker Title

I am attempting to show the title of a map marker using Here Maps.
According to this SO question, the showInfoBubble() is deprecated. And the link it contains goes 404.
However, the official documentation does not show it as deprecated.
My map will always just show two or less locations. And I wanted to show the info bubble with the title. However, showInfoBubble() isn't a method of the MapMarker class despite being shown as one.
I have searched the official GitHub for examples, however I cannot find anything on showing the title.
Has anyone figured this out? Or can you point me to an example or the correct documentation?
private void addMarkerAtPlace(GeoCoordinate marker, String title, String description, Image icon) {
MapMarker mapMarker = new MapMarker();
mapMarker.setIcon(icon);
mapMarker.setCoordinate(new GeoCoordinate(marker));
mapMarker.setTitle(title);
mapMarker.setDescription(description);
m_map.addMapObject(mapMarker);
m_mapObjectList.add(mapMarker);
//Show Title can only be shown after being added to the map
//however this doesn't work!!!
mapMarker.showInfoBubble();
}
Summary: A comment about the deprecation: You refer to the Starter SDK version 3.x, but the linked SO question was about the Premium SDK. Two different products at the moment. Deprecation seems to be the case only for the Premium edition (where MapOverlays have been introduced, what's also not available in Starter as far as I can see).
See current overview for the SDKs over here: https://developer.here.com/products/here-sdk

HERE SDK turn-by-turn navigation maneuvers

In the HERE SDK user guide there is a screenshot showing the next maneuver. See:
https://developer.here.com/mobile-sdks/documentation/android-hybrid-plus/topics/map-guidance.html
Is this something that is provided by the SDK or is the developer expected to render this manually?
Here is the navigation code I am using:
Route route = list.get(0).getRoute();
map.setMapScheme(Map.Scheme.CARNAV_DAY);
map.getPositionIndicator().setVisible(true);
map.setTilt(45);
map.addMapObject(new MapRoute(route));
manager.setRoute(route);
manager.setTrafficAvoidanceMode(NavigationManager.TrafficAvoidanceMode.DYNAMIC);
manager.setRealisticViewMode(NavigationManager.RealisticViewMode.DAY);
manager.setMap(map);
NavigationManager.Error simError = manager.startNavigation(route);
if(simError != NavigationManager.Error.NONE) {
Log.e(LOG_TAG, "Error" + simError);
}
Maybe a bit late, but for the others who are having the same question,
You can use the HERE Mobile SDK UI Kit (MSDKUI) which provides a highly customizable user interface components that can be used on top of the HERE SDKs.
Here is the repo on Github:
https://github.com/heremaps/msdkui-android
Some things are rendered automatically by the HERE SDK, mainly things that are directly tied to the map rendering (like navigation arrows on the street when doing guidance), but most UI things you have to do on your own since most users want to have their own look&feel and UI.
So, yes the maneuver icons are something you have to provide and render in your UI manually (or the other way around: you have the full freedom to decide how it should look like).

Android drag and return to previous activity like Facebook and Google Photos

I have been finding a way to implement animation like Facebook and Google Photos. When in 2nd Activity, when dragging images the images follow and the 2nd Activity started to fade out and we see 1st Activity. Images of what I was trying to ask is here.
Was you able to find a full fledged solution for this ?
https://github.com/nickbutcher/plaid , It might give clues to entry transition and how that was accomplished . So it might help you there. But how about when you want to drag and dismiss that activity?
https://github.com/Commit451/ElasticDragDismissLayout , Its an interesting library. Does do drags . But doesn't remember the position where the thumbnail where it was launched from. Only handles 1 swipe direction and dismisses by sliding to the right. So its not that close to what they do in 2017 Jun Google Photos Android application. You might have to modify it.
If anyone knows a better solution to this please do share.
I have found some code from Nick Butcher sample code.
ElasticDragDismissFrameLayout.java
and when using it:
chromeFader = new ElasticDragDismissFrameLayout.SystemChromeFader(getWindow()) {
#Override
public void onDragDismissed() {
finishAfterTransition();
}
};

ShowAchievementsUI(); don't want to appear on Android

I am using the official PlayGameServices plugin for Unity, and have been following the installation to the point. Authentication seems to work like a charm, but when I want to do the ShowAchievementsUI();, nothing happends. No UI, no errors, no crashes.
Ive been googling around for a while, it seems other people have hit this problem, but with no solution in sight.
My code at the moment is :
using GooglePlayGames;
using UnityEngine.SocialPlatforms;
void Start() {
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.Activate();
LoginSocialGamecenter();
}
public static void LoginSocialGamecenter() {
if (Social.localUser.authenticated) {
Social.ShowAchievementsUI (); Debug.Log("Pancakes!");
return;
}
}
And "Pancakes!" comes out perfectly. Authentication UI on first install also shows up nicely. It fails on all devices I have, but the debug message shows up perfectly on Android.
According to the documentation, it should work as described:
Showing the Achievements UI
To show the built-in UI for all leaderboards, call
Social.ShowAchievementsUI.
using GooglePlayGames;
using UnityEngine.SocialPlatforms;
...
// show achievements UI
Social.ShowAchievementsUI();
This will show a standard UI appropriate for the look and feel of the platform (Android or iOS).
Akhil got it right. There needs to be more than five achievements or the window won't appear.
It will make no error reports on this, simply return false.

Android - Best way to query device for all folders containing images

Im trying to figure out the best way to get all the directories on a device that contain image files. I know how to use all the api's but my application calls for using an in app image gallery rather than just using an intent to launch the gallery. Ive thought of going through the entire device and looking in the directories and check for extensions but that would take a couple seconds to long. Does any one have a better solution? I already have a very solid custom gallery built but my only problem is coming up with a nice solution to get all the images in other places that my app wont know about.
apache commons-io DirectoryWalker
public class ImagesFinder extends DirectoryWalker{
protected boolean handleDirectory(File directory, int depth, Collection results) {
return true;
}
protected void handleFile(File file, int depth, Collection results) {
//
}
}

Categories

Resources