Skip to content

Instantly share code, notes, and snippets.

Avatar
🐼
Thinking

S.Tuğçe Arar stugcearar

🐼
Thinking
View GitHub Profile
View activity_id_response.cs
public virtual long ElapsedTimeFromReboot { get; set; }
public virtual IList<ActivityIdentificationData> ActivityIdentificationDatas { get; set; }
public virtual long Time { get; set; }
public virtual ActivityIdentificationData MostActivityIdentification { get; }
View LocationRequest.cs
public virtual void PutExtras(string p0, string p1);
public virtual LocationRequest SetCountryCode(string p0);
public virtual LocationRequest SetExpirationDuration(long p0);
public virtual LocationRequest SetExpirationTime(long p0);
public virtual LocationRequest SetFastestInterval(long p0);
public virtual LocationRequest SetInterval(long p0);
public virtual LocationRequest SetLanguage(string p0);
public virtual LocationRequest SetMaxWaitTime(long p0);
public virtual LocationRequest SetNeedAddress(bool p0);
public virtual LocationRequest SetNumUpdates(int p0);
View SetSearchResultOnMap.cs
public void SetSearchResultOnMap(IList<Com.Huawei.Hms.Site.Api.Model.Site> sites)
{
hMap.Clear();
if (searchMarkers != null && searchMarkers.Count > 0)
foreach (var item in searchMarkers)
item.Remove();
searchMarkers = new List<Marker>();
for (int i = 0; i < sites.Count; i++)
{
MarkerOptions marker1Options = new MarkerOptions()
View nearby_search_listeners.cs
public class NearbySearchResultListener : Java.Lang.Object, ISearchResultListener
{
private MainActivity context;
public NearbySearchResultListener(MainActivity context)
{
this.context = context;
}
public void OnSearchError(SearchStatus status)
View GeocodeManager_2.cs
public void NearbySearch(LatLng currentLocation, string searchText)
{
ISearchService searchService = SearchServiceFactory.Create(activity, Android.Net.Uri.Encode("YOUR_API_KEY"));
NearbySearchRequest nearbySearchRequest = new NearbySearchRequest();
nearbySearchRequest.Query = searchText;
nearbySearchRequest.Language = "en";
nearbySearchRequest.Location = new Coordinate(currentLocation.Latitude, currentLocation.Longitude);
nearbySearchRequest.Radius = (Integer)2000;
nearbySearchRequest.PageIndex = (Integer)1;
nearbySearchRequest.PageSize = (Integer)5;
View nearby_search.cs
private void btnGeoWithAddress_Click(object sender, EventArgs e)
{
search_view = base.LayoutInflater.Inflate(Resource.Layout.search_alert_layout, null);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.SetView(search_view);
builder.SetTitle("Search Location");
builder.SetNegativeButton("Cancel", (sender, arg) => { builder.Dispose(); });
search_view.FindViewById<Button>(Resource.Id.btnSearch).Click += btnSearchClicked;
alert = builder.Create();
alert.Show();
View search_alert_layout.xml
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="20dp"
android:minWidth="25px"
android:minHeight="25px">
<EditText
android:layout_width="match_parent"
View GeofenceListeners.cs
public class CreateGeoFailListener : Java.Lang.Object, IOnFailureListener
{
private Activity mainActivity;
public CreateGeoFailListener(Activity mainActivity)
{
this.mainActivity = mainActivity;
}
public void OnFailure(Java.Lang.Exception ex)
View GeofenceBroadcastReceiver.cs
[BroadcastReceiver(Enabled = true)]
[IntentFilter(new[] { "com.huawei.hms.geofence.ACTION_PROCESS_ACTIVITY" })]
class GeofenceBroadcastReceiver : BroadcastReceiver
{
public static readonly string ActionGeofence = "com.huawei.hms.geofence.ACTION_PROCESS_ACTIVITY";
public override void OnReceive(Context context, Intent intent)
{
if (intent != null)
{
var action = intent.Action;
View GeofenceManager.cs
class GeofenceManager
{
public MainActivity activity;
public GeofenceManager(MainActivity activity)
{
this.activity = activity;
}
private PendingIntent CreatePendingIntent()
{
You can’t perform that action at this time.