How to add a shortcut to mobile homescreen in Xamarin.Forms? - forms

How can I add a shortcut icon to mobile homescreen in Xamarin.Forms ?
I am a beginner in Xamarin and try to do this.
Edit:
Currently I don't have attached an Mac for IOS, yet
so what I want is to run only Droid for now

If you deploy your Android application via the Android play store, the shortcut will be added to the home screen automatically.
For iOS, it should get added by default when you install the app.

Add the following attribute to your Activity-class:
[Activity (MainLauncher=true)]
public class MainActivity: FormsApplicationActivity {
// ...
}
That should be all. For iOS there is no special action required.

Related

Ionic Android Strange routing when physical key is pressed [Honeywell CK65]

We are developing Ionic android app and we are having a strange problem with Honeywell CK65 device, to be more specific with device physical keyboard.
If the app is being used only by touch, without device physical keyboard, the app is working correctly.
But when physical keyboard is used, example
when ENTER key is pressed, it should navigate to another page but the remain freeze and it appends on the bottom page the previous page.
Any help will be appreciated. thanks in advance.
You need to somehow configure the app to use the devices keyboard. My guess is that you need to create a custom plugin to call the device's built in keyboard and map those keys to a function.
We resolved the problem using ionic ion-router-outlet instead of angular router-outlet

How to close mobile app programmatically using IONIC 5?

How to close the mobile app programmatically using IONIC 5? Use case: Upon app start, I am displaying a Terms of Use popover and if the user does not accept, I need to close the app. I am using IONIC5+Angular.
Thank you.
V
I figured it out.
While navigator['app'].exitApp() works for Android, it does not work for iOS. Also, according to Apple, the apps should not terminate themselves. For my app, I will just display the "Accept" but. The user will need to close the app manually if they don't want to agree to the Terms of Use.
navigator['app'].exitApp();
**that's work for me **
you also use
#capacitor/app
App.exitApp();
Force exit the app. This should only be used in conjunction with the backButton handler for Android to exit the app when navigation is complete.
Ionic handles this itself so you shouldn’t need to call this if using Ionic.
HTML :-
<ion-button color="danger" (click)="close()" fill="clear" expand="block">Close App </ion-button>
TS :-
import { Platform } from '#ionic/angular';
constructor(private platform: Platform) { }
close(){
this.platform.backButton.subscribe( () => {
navigator['app'].exitApp();
})
}

Is there a way to launch notes application in flutter from button click?

I have a button in my app. On click of the button, I want the notes app in the device to get launched whether iOS or Android. I there a way around this with flutter? I haven't discovered any solution yet.
Yes there is this plugin external_app_launcher will helps you to open another app from your app by providing PackageName for Android and URLscheme for IOS external_app_launcher

Customizing page transitions with Convertigo

I am currently building a cross-platform mobile application with Convertigo Studio, and the iOS default transition between pages does not fit well with the design : I would like the transitions between pages in the iOS app to be identical to the Android ones.
I have narrowed the problem to the Ionic navCtrl.push() call, probably made by the Convertigo PushPage component.
According to this blog post, it is possible to force transitions with the animation field of the call configuration object :
this.navCtrl.push(MyPageComponent, null, {animate: true, animation: "transition-android"});
Convertigo Studio allows me to edit the animate and duration fields, but not animation.
Without patching the Studio, is there a way to override the iOS default page transition ?
Yes in 7.5.7 version Convertigo studio does not expose the transition type property for push pages. This has been added in 7.6
Nevertheless, you can customize your template (The mobilebuildet_tpl_7_5_7 project in the workspace) the add a default transition into the app module this way :
in ionicTpl/src/app/app.module.ts
Change line
IonicModule.forRoot(MyApp, {}, deepLinkConfig)
to
IonicModule.forRoot(MyApp, {
pageTransition: 'ios-transition'
}, deepLinkConfig)
This way, all page transitions can be set to iOS or Android mode whatever the app runs on.
Do not forget to reload your project (Right click on project->Reload your project) to have the MobileBuilder to regenerate the Ionic project sources and re-execute the app viewer to rebuild the app.
Hope That Helps !

Flex-Mobile: Should I use the menu-stuff provided or is it better not to because the iphone does not have a menu button?

I would not have asked the question if I owned an iphone, but so far I only have an android phone for development.
The question is: Should I use the View.viewMenuItems that are provided by flex mobile? Or should I better embed the functionality in another way? I don't know what possibilities might exist on iphone to open the menu, because it has no hardware button "menu".
By the way: How could I open the menu in the Flash-Builder mobile device emulator - there are no buttons, too....
Thanks!
you can detect the Menu Button through KeyBoardEvent in Android. In Iphone, the Home Button will exit out your application, so you should do some interface buttons to show your menu.
private function _onAddedToStage(event:FlexEvent):void
{
//removes listener
removeEventListener(Event.ADDED_TO_STAGE, _onAddedToStage);
stage.addEventListener(KeyboardEvent.KEY_DOWN, _onKeyDown);
}
private function _onKeyDown(event:KeyboardEvent):void
{
if(event.keyCode == Keyboard.MENU)
{
event.preventDefault();
_text.appendText("\nMenu Pressed");
}
}
The latest versions of Android's Honeycomb OS does not support the menu button. So if you do take advantage of Flex's ViewMenu feature beware that if you build using Flex 4.6 or newer there won't be a button on the latest Android Tablets and iOS devices.
In ADL you can choose Device > Menu to simulate clicking a hardware menu button.