Create Custom Place Picker using New Google Place API in Xamarin.Android - android

I am trying to create custom place picker for Xamari.Android. I could not find the following plugin in xamarin
com.google.android.libraries.places:places:1.0.0
Can Anyone help me here? I am trying to implement custom place picker using this link: https://codelabs.developers.google.com/codelabs/location-places-android/index.html?index=..%2F..index#8
If you guyz have any other way to sort this out do let me know. I want to create a view to pick a location from a map, search location etc.
Currently I have these package installed.

The com.google.android.libraries.places:places aar library is wrapped via the
Xamarin.Google.Android.Places package (the current version is 1.1.0.2)
https://www.nuget.org/packages/Xamarin.Google.Android.Places/
This Xamarin library source and its sample code are at:
https://github.com/xamarin/XamarinComponents/tree/master/Android/GooglePlaces
From the sample code:
....
if (!PlacesApi.IsInitialized)
PlacesApi.Initialize (this, apiKey);
placesClient = PlacesApi.CreateClient (this);
placesData = new List<PlaceData> ();
....

Related

Which android view should be used to display a jetbrains.letsPlot() + geomHistogram() -object?

I am having some trouble including a Plot-object (produced by jetbrains.letsPlot() + geomHistogram()) within the activity.xml for a Kotlin Android app. I am familiar with basic activity elements but I don't know which one to use in this case and I can not figure it out using https://github.com/JetBrains/lets-plot.
Any help is very appreciated!
You can use Android' WebView to display a plot.
jetbrains.letsPlot() + geomHistogram() produces a Figure object.
First you will have to convert it to a simple Map object using toSpec() method:
val spec = when (plot) {
is Plot -> plot.toSpec()
else -> (plot as GGBunch).toSpec()
}
Next, you will generate a string (plot HTML representation) using PlotHtmlHelper:
val html = PlotHtmlHelper.getStaticDisplayHtmlForRawSpec(spec)
This way you can generate a web page and load it to WebView. The page should also contain a script tag for loading the Lets-Plot JS library.
The code could look similar to this (but with a newer library version - 2.2.1 currently): https://github.com/JetBrains/lets-plot-kotlin/blob/master/demo/browser/src/main/kotlin/frontendContextDemo/BrowserDemoFrontendContext.kt
If you are using Kotlin/JS you may want to take a look at this example as well: https://github.com/alshan/lets-plot-mini-apps/blob/main/js-ir-frontend-app/src/main/kotlin/Main.kt

Android status bar show in Unty

I'm triyng to show the status bar in an Android phone using Unity. I have try this code:
void Start() {
this.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
But an error appear;
Assets/Scenes/Control/control.cs(15,34): error CS0103: The name 'WindowManager' does not exist in the current context
Does I need to call or import another package? Some could help me with this detail. Thanks in advance.
You cannot use Android Java functions directly in Unity. You can only use whats available in Unity C Sharp. Unity doesn’t understand the method. Suggested workaround, use a ‘Slider’ UI element and manipulate it in a custom c sharp script. Complicated workaround create a custom Unity Plugin which calls the native Android method (possible but complex).

Insert icon in a tabbed page(Android) on xamarin form

I'm new to StackOverflow community!
I need help with one problem with android in Xamarin Forms. To be precise... I tried with some friends to build our first app. We choose(with the help of our University professor) Xamarin for the cross-platform development of Android and iOS for both systems using the Xamarin Forms. I created the interface part of the app and now I am stuck in a fort with big walls. When I try to add a Tabbed Page the icon for the functional bar, the app crashes(Android) but in iOS, the problem doesn't appear...
I'd try with some solution... like :
-Render in the NameApp.Droid adds different renderer only for the android part but no result...
-Try another way to insert the icon in the .xaml file directly but no result...
-Try to follow another way to modify the .axam file for the "Theme" part
but no result...
I want to integrate all the stuff on time only in the "Main Project". I don't want for now touch the "nameProject.Droid" or "nameProject.iOS" part, But try to make in one shoot both(Andriod & iOS). I've found a different bug in Android (è.é) but for this, I am going crazy...
But I need to modify the ".Droid" no problem I accept the challenge!
This is the result I aspire to create.
"https://storage.googleapis.com/material-design/publish/material_v_12/assets/0B6Okdz75tqQsbHJuWi04N0ZIc0E/components-tabs-usage-mobile7.png"
This is the way I add the Icon in the Tabbed Page. An assumption I add all the stuff in the "Resource" in ".Droid" and ".iOS :
var MainPageTabbed = new MPageTabbed();
var Profile = new Profile();
var ListChat = new ListChat();
if (Device.RuntimePlatform == Device.Android)
{
MainPageTabbed.Icon = "ldpi.png";
Profile.Icon = "ldpi2.png";
Chat.Icon = "ldpi1.png";
}
if (Device.RuntimePlatform == Device.iOS)
{
MainPageTabbed.Icon = "ldpi.png";
Profile.Icon = "ldpi2.png";
ListChat.Icon = "ldpi1.png";
}
NavigationPage.SetHasNavigationBar(this, false);
Children.Add(MainPageTabbed);
Children.Add(Profile);
Children.Add(ListChat);
Someone can help me please to find a solution?
Here you have an example of how to use the TabbedPage in xamarin forms:
https://developer.xamarin.com/guides/xamarin-forms/application-fundamentals/navigation/tabbed-page/
... Xamarin.forms renders Android tabbed-pages as something called a viewpager combined with a TabPagerStrib, and it looks like the example in the link above.
You might read about BottomNavigationBar for Android instead, or look at this link for a TabPagerStrip with an image:
https://forums.xamarin.com/discussion/39937/adding-icons-to-a-pagertabstrip-instead-of-text
If anyone is interested in a FontAwesome custom icon implementation I followed this tutorial to begin with: FontAwesome with Xamarin Forms
Unfortunately he doesn't give an example of integrating with tabbed pages but after some experimenting I finally figured out a simplified Xaml way to render it without a custom tabbed renderer:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:IBMobile.Views"
xmlns:local2="clr-namespace:FontAwesome"
x:Class="IBMobile.Views.HomePage"
Visual="Material">
<ContentPage.IconImageSource>
<FontImageSource FontFamily="{StaticResource FontAwesomeSolid}" Glyph="{x:Static local2:IconFont.Home}" />
</ContentPage.IconImageSource>

navigation in Android TV

navigation in Android TV.
How do I create just the navigation android tv. I do not care to use the entire theme, it provides android studio.
And I do not understand much of what is in the example given by android studio.
I understand that is something the String.
I looked on the internet examples, but right now, android tv has no further information at this time.
I'm interested only create menu navigation side, nothing more.
Thank you very much.
I found a really nice tutorial : http://corochann.com/browsefragment-header-customization-android-tv-application-hands-on-tutorial-17-697.html
it shows you how to create a custom navigation side with an image and a text
Here what a tried in my application :
copy his IconHeaderItem class and in your loadRows paste
IconHeaderItem gridItemPresenterHeader = new IconHeaderItem(0, BEWELL_THERMO, R.drawable.bewell_thermo);
GridItemPresenter mGridPresenter = new GridItemPresenter();
ArrayObjectAdapter gridRowAdapter = new ArrayObjectAdapter(mGridPresenter);
gridRowAdapter.add(DERNIERE_MESURE);
gridRowAdapter.add(GRID_STRING_GUIDED_STEP_FRAGMENT);
gridRowAdapter.add(GRID_STRING_RECOMMENDATION);
gridRowAdapter.add(GRID_STRING_SPINNER);
mGridItemListRow = new ListRow(gridItemPresenterHeader, gridRowAdapter);
mRowsAdapter.add(mGridItemListRow);
setAdapter(mRowsAdapter);

How can I make or use a pattern like the newest gmail (for android v5.0)

As we all know,google release the android L,and the gmail went into more beautiful.Now I want to use this pattern like the pic,I searched it everywhere,github included, only to find that nothing.
THX deeply in advanced! Here is the pic:
oh!I'm sorry,I forget to mention that the new refresh layout,could you see the circle within a Curved arrow.swipe the screen down,and it begin to refresh,maybe it's s new swipefreshlayout,thx!
This is the new SwipeRefreshLayout class that is included in the latest support library. The implementation is exactly the same as the old support swipeRefresh layout
Here an overview:
http://www.google.com/design/spec/material-design/introduction.html
Here is explained how to use it: https://developer.android.com/training/material/index.html

Categories

Resources