Click here to Skip to main content
15,885,546 members
Articles / All Topics

How to develop universal apps for IoT device

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
19 Sep 2015MIT1 min read 5.6K   1  
This post is about developing apps for your IoT device. In the last post I mentioned about installing and booting Windows IoT core on Raspberry PI 2. In this post we will look into the application development for IoT devices.

This article is an entry in our Microsoft Azure IoT Contest. Articles in this section are not required to be full articles so care should be taken when voting.

This post is about developing apps for your IoT device. In the last post I mentioned about installing and booting Windows IoT core on Raspberry PI 2. In this post we will look into the application development for IoT devices.

Prerequisite

  1. Visual Studio 2015
  2. IoT extension SDK
  3. Developer mode should be enabled in Windows 10. If not enabled, you can do it via Settings > Security and Update. And you need to select Developer mode.

    Windows 10 - Enable Developer mode

    Windows 10 – Enable Developer mode

Developing a Hello World Application for Raspberry PI 2

  1. Open Visual Studio, and Select Blank App (Windows Universal) from Universal project templates.
  2. IoT extension SDK is not added to projects by default, if you need to access some device GPIO, you need to add reference of “Windows IoT Extensions for the UWP”, you can do it from Add References > Universal Windows > Extensions > Windows IoT Extensions for the UWP.
  3. Now you can add some content to your MainPage.XAML file.
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Button HorizontalAlignment="Center" Grid.Row="0" Content="Hello World" FontSize="65" />
        <TextBlock Grid.Row="1" Style="{StaticResource HeaderTextBlockStyle}" 
                VerticalAlignment="Center" FontSize="100" HorizontalAlignment="Center" Text="Hello World" />
    </Grid>

    This application contains one button and one label, both shows Hello World. I don’t have any code behind.

  4. Once your app is created, change the target architecture to “ARM”, select “Remote machine” from the list of target devices dropdown. If no remote machine configured, Visual Studio will display a Remote connections dialog like this.
    Remote machine settings

    Remote machine settings

    If your Rasberry PI connected and detected, you can select it from Auto Detected remote connections. If it is not available, you need provide the IP Address or machine name, and change the authentication mode as “None”.

Once all the configurations completed, you can debug the project using Visual Studio.

Happy Programming :)

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Technical Lead
India India
Working as Tech. Lead

My blog : dotnetthoughts.net.
You can follow me in twitter : @anuraj

Comments and Discussions

 
-- There are no messages in this forum --