Range Input Generator <a href=https://adri.epizy.com >
Tuesday, 28 August 2018
Xamarin Popup Menu
https://www.sonjukta.com/css-range-input-generator.phpXamarin has several options for menu. Side menu, Popup menu etc. In this
article will discuss about the popup menu, how a popup menu can be
create and how we will use this menu for real life programming
purpose. Popup menu can be populated in two ways, from XML file or it be
populated from dynamically via program.
Popup menu programming from XML file
1)First create XML file,in the menu folder and Resource.
Resources>>menu>>Popup_menu.xml
Now add code for menu and item.
2)In the Layout .axml file , add a button.The code and the output is.
3)In activity ,Place this code.Button click will open the Popup menu.You have to mention your xml file in the resource menu.
Popup menu dynamically populate
A popup menu can be dynamically populated by programming also.
First we have to declare a Popup menu variable, then add menu item to it . Each menu have a item it entities corresponding text to display.We have added a button to display the menu.
Layout Page
Activity.cs
Now, we have learn how to populate a Menu. The next text is how to handle Menu click event. From Menu click event you have to move forward the layout you want to display. Because in real life software, each menu item display unique layout. Here is the example how menu click event can be handled.
In the above example , menu clicked was handled.Menu click transfer layout from one layout to another layout.
Popup menu programming from XML file
1)First create XML file,in the menu folder and Resource.
Resources>>menu>>Popup_menu.xml
Now add code for menu and item.
xml
version
= "1.0"
encoding="utf-8"?>
<menu
xmlns:android
= "http://schemas.android.com/apk/res/android">
<item
android:id
= "@+id/file_settings"
android:title
= "Settings"
android:showAsAction
= "ifRoom">
<item
android:id
= "@+id/new_game1"
android:title
= "New
File Settings"/>
<item
android:id
= "@+id/help"
android:title
= "Help"
/>
<item
android:id
= "@+id/about_app"
android:title
= "About
app"/>
</item>
</menu>
2)In the Layout .axml file , add a button.The code and the output is.
xml
version="1.0"
encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
android:background="#194575">
<Button
android:id="@+id/BtnLogin"
android:layout_width="100dp"
android:layout_height="45dp"
android:text="Open
Popup"
android:background="#F18D00"
android:gravity="center"
/>
</LinearLayout>
3)In activity ,Place this code.Button click will open the Popup menu.You have to mention your xml file in the resource menu.
using
System;
using
Android.App;
using
Android.Widget;
using
Android.OS;
using
Android.Support.Design.Widget;
using
Android.Support.V7.App;
using
Android.Views;
using
Android.Runtime;
namespace
App6
{
[Activity(Label
= "@string/app_name",
Theme = "@style/AppTheme.NoActionBar",
MainLauncher = true)]
public
class
MainActivity
: AppCompatActivity
{
protected
override
void
OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.activity_main);
Button
objMenu = FindViewById
objMenu.Click
+= (s1, arg1) =>
{
PopupMenu
menu = new
PopupMenu(this,
objMenu);
menu.Inflate(Resource.Menu.Popup_menu);
menu.Show();
};
}
}
}
Output :
Popup menu dynamically populate
A popup menu can be dynamically populated by programming also.
First we have to declare a Popup menu variable, then add menu item to it . Each menu have a item it entities corresponding text to display.We have added a button to display the menu.
Layout Page
xml
version="1.0"
encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
android:background="#194575">
<Button
android:id="@+id/BtnLogin"
android:layout_width="100dp"
android:layout_height="45dp"
android:text="Open
Popup"
android:background="#F18D00"
android:gravity="center"
/>
</LinearLayout>
Activity.cs
Button
objMenu = FindViewById
objMenu.Click
+= (s1, arg1) =>
{
PopupMenu
menu = new
PopupMenu(this,
objMenu);
menu.Menu.Clear();
menu.Menu.Add("New
Menu 1");
menu.Menu.Add("New
Menu 2");
menu.Menu.Add("New
Menu 3");
menu.Menu.Add("New
Menu 4");
menu.Show();
};
Now, we have learn how to populate a Menu. The next text is how to handle Menu click event. From Menu click event you have to move forward the layout you want to display. Because in real life software, each menu item display unique layout. Here is the example how menu click event can be handled.
PopupMenu
menu = new
PopupMenu(ctts, menuObject);
Android.Content.Intent
i;
menu.MenuItemClick
+= (s1, arg1) =>
{
Android.Content.Intent
i;
switch
(arg1.Item.ItemId)
{
case
0:
i
= new
Android.Content.Intent(ctts, typeof(logout_activity));
this.StartActivity(i);
break;
default:
//do
a different thing
break;
}
};
In the above example , menu clicked was handled.Menu click transfer layout from one layout to another layout.
Xamarin Run Your Application on Android Mobile
RANGE INPUT GENERATORIn this article we will discuss ,how to publish an Android application and how to run
it on Android mobile.Xamarin support multiple platform like Windows, Android, iOS.
Xamarin application publish is quite simple. Let's see an
example.
1) The first step is,Right click on your application , a context menu will appear.Select "Archive".
2) Now, go to Project Properties>>Application Options
In the "Pakage Properties"
uncheck>>Shared Runtime
uncheck>>Use Fast Deployment(debug mode only)
3)Now go to "Application"
Select the target Android version , you want to run your solution.
4)Right click your project and select "Archive". You'll see a progress bar will appear and running.
5)Wait for some time, once it is completed ,you will get two
a)Open Folder
b)Distribute
Click on "Distribution" . A New Window will appear.
6)The new window will give you two option
a)Ad Hod
b)Google Play
We will not upload this application to the Google Play Store ,we will do it "Ad Hod" basis.
7)click on "Ad Hod" , a New Window will appear. Put your own information,It will generate a new Signed Identity.
9)Now click on "Save As" , the system will ask you the name of the "apk" file for your project. Enter the name of your "apk" file and save it.
10) Now go to the path where you save "apk" file.
11) Connect your mobile with USB cable. Your mobile will show you as a driver of computer.Copy you "apk" from computer and Paste to Mobile drive. It is recommended to Paste the file to the download folder.
12) On your Android phone, open File Manager>>download folder. Double click on the "apk" file. Follow the instructions. Your project will be install and run successfully.
1) The first step is,Right click on your application , a context menu will appear.Select "Archive".
2) Now, go to Project Properties>>Application Options
In the "Pakage Properties"
uncheck>>Shared Runtime
uncheck>>Use Fast Deployment(debug mode only)
3)Now go to "Application"
Select the target Android version , you want to run your solution.
4)Right click your project and select "Archive". You'll see a progress bar will appear and running.
5)Wait for some time, once it is completed ,you will get two
a)Open Folder
b)Distribute
Click on "Distribution" . A New Window will appear.
6)The new window will give you two option
a)Ad Hod
b)Google Play
We will not upload this application to the Google Play Store ,we will do it "Ad Hod" basis.
7)click on "Ad Hod" , a New Window will appear. Put your own information,It will generate a new Signed Identity.
9)Now click on "Save As" , the system will ask you the name of the "apk" file for your project. Enter the name of your "apk" file and save it.
10) Now go to the path where you save "apk" file.
11) Connect your mobile with USB cable. Your mobile will show you as a driver of computer.Copy you "apk" from computer and Paste to Mobile drive. It is recommended to Paste the file to the download folder.
12) On your Android phone, open File Manager>>download folder. Double click on the "apk" file. Follow the instructions. Your project will be install and run successfully.
Monday, 27 August 2018
Xamarin Create Accelerator
RANGE INPUT GENERATOR Xamarin is a cross platform software development
environment. Software development is done in computer , then packages created and
distributed to the mobile in Windows , Android , iOS platform. Here we
will discuss how to run Android and how to create a emulator.
To create Accelerator
1)"Tools">>Android>>Android Device Manager.
2)ADB Manager new window will be open.
This new window show the list of existing Accelerator.You can select any Accelerator , delete , update ,copy existing .
3)Click on "+New", another new window will open.
4)Enter the name of your Accelerator, select the target Android version .List of property will come, selective property, click on "Create".
4)If Android SDK Ptatform and Google API System Imgae for this version already downloaded , then Accelerator will create instantly.
Else it will download automatically and create Accelerator.
Now , your Accelerator is created, you need to go
"Tools">> "restart ADB manager".
He will add your newly created accelerator in the accelerator list.
Either close your Visual Studio and open again you will get this accelerator on list.Choose Accelerator and Press "F5" , you solution will be shown in the accelerator.
To create Accelerator
1)"Tools">>Android>>Android Device Manager.
2)ADB Manager new window will be open.
This new window show the list of existing Accelerator.You can select any Accelerator , delete , update ,copy existing .
3)Click on "+New", another new window will open.
4)Enter the name of your Accelerator, select the target Android version .List of property will come, selective property, click on "Create".
4)If Android SDK Ptatform and Google API System Imgae for this version already downloaded , then Accelerator will create instantly.
Else it will download automatically and create Accelerator.
Now , your Accelerator is created, you need to go
"Tools">> "restart ADB manager".
He will add your newly created accelerator in the accelerator list.
Either close your Visual Studio and open again you will get this accelerator on list.Choose Accelerator and Press "F5" , you solution will be shown in the accelerator.
Subscribe to:
Posts (Atom)
বাঙালির বেড়ানো সেরা চারটি ঠিকানা
বাঙালি মানে ঘোড়া পাগল | দু একদিন ছুটি পেলো মানে বাঙালি চলল ঘুরতে | সে সমুদ্রই হোক , পাহাড়ি হোক বা নদী হোক। বাঙালির ...
-
Garbage collection Garbage collection is a technique to recover the memory consumed by some unused variable and objec...
-
Another weekend Getaway of Odisha is Balasore, commonly known as Baleshwar . Balasore is a district of Odisha,India. Chandipur : Chandi...
-
What is json.stringify ? If the stringify method sees an object that contains a toJSON method, it calls that method, and stringifies the ...