IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Windows Phone .NET Discussion :

Géolocalisation sur application Mobile


Sujet :

Windows Phone .NET

  1. #1
    Membre du Club
    Inscrit en
    Juin 2009
    Messages
    154
    Détails du profil
    Informations forums :
    Inscription : Juin 2009
    Messages : 154
    Points : 55
    Points
    55
    Par défaut Géolocalisation sur application Mobile
    Bonjour,

    je débute en programation Mobile.
    JE veux mettre en place une application Moible en DotNet qui permettera la consultation des données déjà saisie par une autre application (enregistré sur base oracle).
    J'utiliserais visuel Studio et je voulais savoir comment faire pour integrer la géolocalisation dans mon application ?? (une fonction avancé du téléphone)
    C'est un web service à integrer ??

    merci d'avance pour l'aide que vous allez m'apporter.

  2. #2
    Rédacteur

    Homme Profil pro
    Inscrit en
    Septembre 2007
    Messages
    494
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Septembre 2007
    Messages : 494
    Points : 1 057
    Points
    1 057
    Par défaut
    Salut,

    non pas besoin de webservice Je te conseille cet article : http://create.msdn.com/en-US/educati...on_Services%29 , tu devrais trouver ton bonheur

  3. #3
    Membre du Club
    Inscrit en
    Juin 2009
    Messages
    154
    Détails du profil
    Informations forums :
    Inscription : Juin 2009
    Messages : 154
    Points : 55
    Points
    55
    Par défaut
    Bonsoir,

    Ma version Visual Studio actuelle, 2008, ne me permet pas de créer un projet Silverlight !!!

    Pouvez vous m'aider et me montrer comment faire pour avoir ce type de projet sur mon visual studio !?

    merci d'avance

  4. #4
    Membre expérimenté Avatar de DotNET74
    Homme Profil pro
    Watch R&D Engineer & Apprenti .NET
    Inscrit en
    Août 2003
    Messages
    1 986
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 51
    Localisation : France

    Informations professionnelles :
    Activité : Watch R&D Engineer & Apprenti .NET

    Informations forums :
    Inscription : Août 2003
    Messages : 1 986
    Points : 1 453
    Points
    1 453
    Par défaut
    Il faut installer le Silverlight Toolkit que tu peux trouver sur Codeplex.

    Ensuite, tu peux aussi installer le Silverlight Toolkit pour Windows Phone toujours sur Codeplex.

    A+
    La Théorie c'est quand on comprends tout mais que rien ne fonctionne.
    La Pratique c'est quand tout fonctionne mais qu'on ne sait pas pourquoi !

    Si vous aimez ma réponse, cliquez sur la main verte Merci

  5. #5
    Rédacteur

    Homme Profil pro
    Inscrit en
    Septembre 2007
    Messages
    494
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Septembre 2007
    Messages : 494
    Points : 1 057
    Points
    1 057
    Par défaut
    Il faut aussi installer les outils de développement windows phone (si ce n'est pas déjà fait ) : http://create.msdn.com/en-US/

  6. #6
    Membre du Club
    Inscrit en
    Juin 2009
    Messages
    154
    Détails du profil
    Informations forums :
    Inscription : Juin 2009
    Messages : 154
    Points : 55
    Points
    55
    Par défaut
    Citation Envoyé par Finality Voir le message
    Il faut aussi installer les outils de développement windows phone (si ce n'est pas déjà fait ) : http://create.msdn.com/en-US/
    Visual Studio n'est pas suffisant ?
    merci de m'indiquer les noms des outils dont j'aurais besoin.
    je suis un perdue.

    Merci d'avance

  7. #7
    Membre expérimenté Avatar de DotNET74
    Homme Profil pro
    Watch R&D Engineer & Apprenti .NET
    Inscrit en
    Août 2003
    Messages
    1 986
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 51
    Localisation : France

    Informations professionnelles :
    Activité : Watch R&D Engineer & Apprenti .NET

    Informations forums :
    Inscription : Août 2003
    Messages : 1 986
    Points : 1 453
    Points
    1 453
    Par défaut
    Hello,

    Effectivement !

    Il faut avoir un Visual Studio avec le SP1 en premier lieu

    en plus de Visual Studio il te faut:

    - Windows Phone Tools 7.0 (Microsoft)
    - Silverlight ToolKit for Windows Phone (CodePlex).
    - RIA Service (CodePlex).
    - Optionnellement Windows Phone SDK 7.1 pour la future mise à jour

    Et pour compléter je te recommande d'installer aussi:

    - Silverlight Toolkit

    Voilà
    La Théorie c'est quand on comprends tout mais que rien ne fonctionne.
    La Pratique c'est quand tout fonctionne mais qu'on ne sait pas pourquoi !

    Si vous aimez ma réponse, cliquez sur la main verte Merci

  8. #8
    Membre du Club
    Inscrit en
    Juin 2009
    Messages
    154
    Détails du profil
    Informations forums :
    Inscription : Juin 2009
    Messages : 154
    Points : 55
    Points
    55
    Par défaut
    Merci beaucoup,

    je peux savoir à quoi sert le RIA Service ?

    Aussi, il me demande Visual Studio 2010 pour l'installer, est ce obligatoire d'avaoir VS 2010 ?

    Je suis entrain d'installer WCF RIA Services Toolkit (April 2011), ça fera l'affaire ?

    Merci d'avance

  9. #9
    Membre du Club
    Inscrit en
    Juin 2009
    Messages
    154
    Détails du profil
    Informations forums :
    Inscription : Juin 2009
    Messages : 154
    Points : 55
    Points
    55
    Par défaut
    Citation Envoyé par Finality Voir le message
    Salut,

    non pas besoin de webservice Je te conseille cet article : http://create.msdn.com/en-US/educati...on_Services%29 , tu devrais trouver ton bonheur
    Merci pour le site, j'ai suivie les étapes à la lettre, voilà le resultat :

    MainPage.xaml :
    Code xaml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
        <phone:PhoneApplicationPage 
        x:Class="WindowsPhoneApplication2.MainPage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
        xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
        FontFamily="{StaticResource PhoneFontFamilyNormal}"
        FontSize="{StaticResource PhoneFontSizeNormal}"
        Foreground="{StaticResource PhoneForegroundBrush}"
        SupportedOrientations="Portrait" Orientation="Portrait"
        shell:SystemTray.IsVisible="True" xmlns:my="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps">
     
        <!--LayoutRoot is the root grid where all page content is placed-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,12">
            <TextBlock Height="30" Margin="12,6,395,0" Name="textBlock1" Text="Long:"
    VerticalAlignment="Top" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,42,0,0" Name="textBlock2"
    Text="Lat:" VerticalAlignment="Top" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="71,6,0,0"
    Name="longitudeTextBlock" Text="Long" VerticalAlignment="Top" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="53,42,0,0"
    Name="latitudeTextBlock" Text="Lat" VerticalAlignment="Top" />
            <my:Map Height="352" HorizontalAlignment="Left" Margin="12,322,0,0" Name="map1"
    VerticalAlignment="Top" Width="421" CredentialsProvider="KEY" ZoomLevel="1" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,196,0,0"
    Name="textBlock3" Text="Status:" VerticalAlignment="Top" />
            <TextBlock Height="66" HorizontalAlignment="Left" Margin="78,196,0,0"
    Name="statusTextBlock" Text="Status TextBlock w/TextWrapping=&quot;Wrap&quot;"
    VerticalAlignment="Top" Width="355" TextWrapping="Wrap" />
            <Button Content="Track Me On Map" Height="72" HorizontalAlignment="Left"
    Margin="0,256,0,0" Name="button1" VerticalAlignment="Top" Width="255"
    Click="trackMe_Click" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,78,0,0"
    Name="textBlock4" Text="Speed:" VerticalAlignment="Top" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="78,78,0,0"
    Name="speedreadout" Text="Meters Per Second" VerticalAlignment="Top" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,114,0,0"
    Name="textBlock6" Text="Course:" VerticalAlignment="Top" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="84,114,0,0"
    Name="coursereadout" Text="Heading in Degrees (0=N)" VerticalAlignment="Top"
    Width="339" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,150,0,0"
    Name="textBlock5" Text="Altitude:" VerticalAlignment="Top" />
            <TextBlock Height="30" HorizontalAlignment="Left" Margin="93,150,0,0"
    Name="altitudereadout" Text="Altitude in Meters (0=Sea Level)"
    VerticalAlignment="Top" />
            <Button Content="Stop LocServ" Height="72" HorizontalAlignment="Left"
    Margin="235,256,0,0" Name="button2" VerticalAlignment="Top"
    Width="209" Click="startStop_Click" />
        </Grid>
     
        <!--Sample code showing usage of ApplicationBar-->
        <!--<phone:PhoneApplicationPage.ApplicationBar>
            <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
                <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
                <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
                <shell:ApplicationBar.MenuItems>
                    <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                    <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
                </shell:ApplicationBar.MenuItems>
            </shell:ApplicationBar>
        </phone:PhoneApplicationPage.ApplicationBar>-->
     
    </phone:PhoneApplicationPage>

    MainPage.xaml.cs :
    Code c# : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Shapes;
    using Microsoft.Phone.Controls;
    using Microsoft.Phone.Controls.Maps;
    using System.Device.Location;
    using System.Threading;
     
     
     
    namespace WindowsPhoneApplication2
    {
        public partial class MainPage : PhoneApplicationPage
        {
            GeoCoordinateWatcher watcher;
            bool trackingOn = false;
            Pushpin myPushpin = new Pushpin();
     
            // Constructor
            public MainPage()
            {
                InitializeComponent();
                // instantiate watcher, setting its accuracy level and movement threshold.
                watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High); // using high accuracy;
                watcher.MovementThreshold = 10.0f; // meters of change before "PositionChanged"
                // wire up event handlers
                watcher.StatusChanged += new
                EventHandler<GeoPositionStatusChangedEventArgs>(watcher_StatusChanged);
                watcher.PositionChanged += new
                EventHandler<GeoPositionChangedEventArgs<GeoCoordinate>>(watcher_PositionChanged);
                // start up LocServ in bg; watcher_StatusChanged will be called when complete.
                new Thread(startLocServInBackground).Start();
                statusTextBlock.Text = "Starting Location Service...";
            }
     
            void watcher_StatusChanged(object sender, GeoPositionStatusChangedEventArgs e)
            {
                switch (e.Status)
                {
                    case GeoPositionStatus.Disabled:
                        // The Location Service is disabled or unsupported.
                        // Check to see if the user has disabled the Location Service.
                        if (watcher.Permission == GeoPositionPermission.Denied)
                        {
                            // The user has disabled the Location Service on their device.
     
                            statusTextBlock.Text = "You have disabled Location Service.";
                        }
                        else
                        {
                            statusTextBlock.Text = "Location Service is not functioning on this device.";
                        }
                        break;
                    case GeoPositionStatus.Initializing:
                        statusTextBlock.Text = "Location Service is retrieving data...";
                        // The Location Service is initializing.
                        break;
                    case GeoPositionStatus.NoData:
                        // The Location Service is working, but it cannot get location data.
                        statusTextBlock.Text = "Location data is not available.";
                        break;
                    case GeoPositionStatus.Ready:
                        // The Location Service is working and is receiving location data.
                        statusTextBlock.Text = "Location data is available.";
                        break;
                }
            }
     
     
            void startLocServInBackground()
            {
                watcher.TryStart(true, TimeSpan.FromMilliseconds(60000));
            }
     
            private void trackMe_Click(object sender, RoutedEventArgs e)
            {
                if (trackingOn)
                {
                    button1.Content = "Track Me On Map";
                    trackingOn = false;
                    map1.ZoomLevel = 1.0f;
                }
                else
                {
                    button1.Content = "Stop Tracking";
                    trackingOn = true;
                    map1.ZoomLevel = 16.0f;
                }
            }
            private void startStop_Click(object sender, RoutedEventArgs e)
            {
                if (button2.Content.ToString() == "Stop LocServ")
                {
                    button2.Content = "Start LocServ";
                    statusTextBlock.Text = "Location Services stopped...";
                    watcher.Stop();
                }
                else if (button2.Content.ToString() == "Start LocServ")
                {
                    button2.Content = "Stop LocServ";
                    statusTextBlock.Text = "Starting Location Services...";
                    new Thread(startLocServInBackground).Start();
                }
            }
     
            void watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
            {
                //update the TextBlock readouts
     
                latitudeTextBlock.Text = e.Position.Location.Latitude.ToString("0.0000000000000");
                longitudeTextBlock.Text = e.Position.Location.Longitude.ToString("0.0000000000000");
                speedreadout.Text = e.Position.Location.Speed.ToString("0.0") + " meters per second";
                coursereadout.Text = e.Position.Location.Course.ToString("0.0");
                altitudereadout.Text = e.Position.Location.Altitude.ToString("0.0");
                // update the Map if the user has asked to be tracked.
                if (trackingOn)
                {
                    // center the pushpin and map on the current position
                    myPushpin.Location = e.Position.Location;
                    map1.Center = e.Position.Location;
                    // if this is the first time that myPushpin is being plotted, plot it!
                    if (map1.Children.Contains(myPushpin) == false) { map1.Children.Add(myPushpin); };
                }
            }
     
     
        }
    }

    C'est bon jusque la.

    mais quand je veux executer, je clique la flèche verte avec Windows Phone 7 emulateur.

    L'émulateur s'ouvre, affiche Windows Phone Emuliteur Loding .. , se refreme,puis s'ouvre une deuxième fois avec le message
    Windows Phone Emuliteur is doing a os boot ..
    puis se refreme.

    puis sur mon visual studio phone j'ai un message :
    l'object invoqué s'est deconnecté de ses client
    je ne comprends pas qu'est ce qui ne marche pas.

    Merci d'avance de m'aider

Discussions similaires

  1. Developpement application mobile sur mobile samsung
    Par guillaume84 dans le forum C++
    Réponses: 7
    Dernier message: 13/08/2008, 19h28
  2. Réponses: 1
    Dernier message: 25/02/2008, 18h43
  3. application qui marche sur pc et sur le mobile
    Par phoenix8006 dans le forum Interfaces Graphiques en Java
    Réponses: 1
    Dernier message: 02/03/2007, 21h08

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo