Autore Topic: visualizzare luogo su mappa  (Letto 1138 volte)

Offline AriTiAdoro

  • Utente junior
  • **
  • Post: 98
  • Da soli non si va da nessuna parte!!
  • Respect: +1
    • Mostra profilo
  • Sistema operativo:
    Windows 7
visualizzare luogo su mappa
« il: 21 Settembre 2011, 10:58:50 CEST »
0
Ciao a tutti.
E' possibile ,dato un indirizzo(nel vero senso del termine,per esempio Via Roma 2) uno stato e una città,ottenere latitudine e longitudine del luogo e visualizzarlo anche su una mappa?
Mi consigliereste qualche esempio/tutorial? Grazie
Simo :)

Offline teskio

  • Moderatore globale
  • Utente normale
  • *****
  • Post: 387
  • Respect: +118
    • Github
    • Google+
    • Mostra profilo
    • Skullab
  • Dispositivo Android:
    Cubot GT99 / SurfTab Ventos 10.1
  • Play Store ID:
    Skullab Software
  • Sistema operativo:
    windows 7 / ubuntu 12.04
Re:visualizzare luogo su mappa
« Risposta #1 il: 22 Settembre 2011, 00:25:36 CEST »
0
Si è possibile, ad esempio usando Google Maps, applicazione generalmente preinstallata sui dispositivi android. Basta creare un Intent contenente le informazioni da cercare (attraverso un oggetto Uri)  e lanciare l'Activity associata, la quale aprirà Google Maps cercando l'indirizzo e mostrandolo.

Codice (Java): [Seleziona]
Intent intentMaps = new Intent(Intent.ACTION_VIEW,Uri.parse("geo:0,0?q=my+street+address"));
startActivity(intentMaps)

Ti rimando alla pagina della documentazione dove c'è la lista degli intent utilizzabili per invocare le Google Apps : Intents List: Invoking Google Applications on Android Devices

Per il "reverse geocoding" guarda qui : Geocoder | Android Developers
E qui un snippet presente sul forum : Reverse geocoding: coordinate gps partendo da informazioni relative all'area

Ah quel benedetto tasto "Ricerca"  :-P
« Ultima modifica: 22 Settembre 2011, 00:31:37 CEST da teskio »

Offline AriTiAdoro

  • Utente junior
  • **
  • Post: 98
  • Da soli non si va da nessuna parte!!
  • Respect: +1
    • Mostra profilo
  • Sistema operativo:
    Windows 7
Re:visualizzare luogo su mappa
« Risposta #2 il: 22 Settembre 2011, 08:46:13 CEST »
0
Si infatti avevo provato prorpio il reverse Geocoding con l'esempio che mi hai dato tu,ma l ho provato tutto il pomeriggio ieri ma mi da sempre 'null' sulla latitudine e longitudine, non capisco proprio perchè!!

Codice (Java): [Seleziona]
public class Act extends Activity {

       
         private Double lat;
     private Double lon;
     
                 
          public void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
           
             
           
             
             
             
              String streetAdress = "Colosseo, Roma";
              Geocoder gc = new Geocoder(Act.this, Locale.getDefault());
                try {
                    List<Address> addressList = gc.getFromLocationName(streetAdress,1);
                    if (addressList.size() > 0) {
                        Address address = addressList.get(0);
                        if(address.hasLatitude() && address.hasLongitude()){
                                lat=address.getLatitude();
                            lon=address.getLongitude();
                         
                        }
                    }else
                        Log.d("info", "no matches were found or there is no backend service available.");
                } catch (IOException e) {}
               
               
              Log.i("lat",":" + lat);
              Log.i("lon",":" + lon);
         }
         
       
         
        }
Simo :)

Offline teskio

  • Moderatore globale
  • Utente normale
  • *****
  • Post: 387
  • Respect: +118
    • Github
    • Google+
    • Mostra profilo
    • Skullab
  • Dispositivo Android:
    Cubot GT99 / SurfTab Ventos 10.1
  • Play Store ID:
    Skullab Software
  • Sistema operativo:
    windows 7 / ubuntu 12.04
Re:visualizzare luogo su mappa
« Risposta #3 il: 22 Settembre 2011, 10:49:31 CEST »
0
Citazione da: Geocoder | Class Overview
The Geocoder class requires a backend service that is not included in the core android framework. The Geocoder query methods will return an empty list if there no backend service in the platform. Use the isPresent() method to determine whether a Geocoder implementation exists.

Offline AriTiAdoro

  • Utente junior
  • **
  • Post: 98
  • Da soli non si va da nessuna parte!!
  • Respect: +1
    • Mostra profilo
  • Sistema operativo:
    Windows 7
Re:visualizzare luogo su mappa
« Risposta #4 il: 22 Settembre 2011, 10:59:36 CEST »
0
Codice (Java): [Seleziona]
09-22 08:52:30.327: INFO/ActivityManager(69): Starting: Intent { flg=0x10000000 cmp=com.google.android.gsf/.update.SystemUpdateInstallDialog } from pid 276
09-22 08:52:30.827: INFO/Process(69): Sending signal. PID: 212 SIG: 3
09-22 08:52:30.827: INFO/dalvikvm(212): threadid=4: reacting to signal 3
09-22 08:52:30.877: INFO/dalvikvm(212): Wrote stack traces to '/data/anr/traces.txt'
09-22 08:52:30.897: INFO/Process(69): Sending signal. PID: 276 SIG: 3
09-22 08:52:30.897: INFO/dalvikvm(276): threadid=4: reacting to signal 3
09-22 08:52:31.007: INFO/dalvikvm(276): Wrote stack traces to '/data/anr/traces.txt'
09-22 08:52:31.017: INFO/Process(69): Sending signal. PID: 119 SIG: 3
09-22 08:52:31.017: INFO/dalvikvm(119): threadid=4: reacting to signal 3
09-22 08:52:31.217: INFO/ActivityManager(69): Start proc com.android.email for broadcast com.android.email/.service.EmailBroadcastReceiver: pid=291 uid=10024 gids={3003, 1015}
09-22 08:52:31.228: INFO/Process(69): Sending signal. PID: 130 SIG: 3
09-22 08:52:31.267: INFO/dalvikvm(130): threadid=4: reacting to signal 3
09-22 08:52:31.427: INFO/Process(69): Sending signal. PID: 186 SIG: 3
09-22 08:52:31.427: INFO/dalvikvm(186): threadid=4: reacting to signal 3
09-22 08:52:31.477: INFO/dalvikvm(119): Wrote stack traces to '/data/anr/traces.txt'
09-22 08:52:31.727: ERROR/ActivityManager(69): Start proc com.android.email for broadcast com.android.email/.service.EmailBroadcastReceiver: pid=291 uid=10024 gids={3003, 1015}Load: 9.12 / 2.67 / 0.92
09-22 08:52:31.727: ERROR/ActivityManager(69): CPU usage from 7204ms to 0ms ago:
09-22 08:52:31.727: ERROR/ActivityManager(69):   29% 130/com.android.launcher: 21% user + 8.4% kernel / faults: 2627 minor 26 major
09-22 08:52:31.727: ERROR/ActivityManager(69):   28% 69/system_server: 14% user + 13% kernel / faults: 1423 minor 15 major
09-22 08:52:31.727: ERROR/ActivityManager(69):   15% 264/zygote: 9.3% user + 6.5% kernel / faults: 1591 minor 26 major
09-22 08:52:31.727: ERROR/ActivityManager(69):   2.2% 186/android.process.acore: 1.3% user + 0.8% kernel / faults: 705 minor 7 major
09-22 08:52:31.727: ERROR/ActivityManager(69):   1.8% 119/com.android.inputmethod.latin: 0.8% user + 0.9% kernel / faults: 312 minor
09-22 08:52:31.727: ERROR/ActivityManager(69):   1.5% 246/com.android.defcontainer: 0.5% user + 0.9% kernel / faults: 591 minor 2 major
09-22 08:52:31.727: ERROR/ActivityManager(69):   0.5% 40/adbd: 0.1% user + 0.4% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):   0.5% 126/com.android.systemui: 0.5% user + 0% kernel / faults: 211 minor
09-22 08:52:31.727: ERROR/ActivityManager(69):   0.5% 212/zygote: 0% user + 0.5% kernel / faults: 311 minor 3 major
09-22 08:52:31.727: ERROR/ActivityManager(69):   0.4% 32/zygote: 0% user + 0.4% kernel / faults: 79 minor
09-22 08:52:31.727: ERROR/ActivityManager(69):   0.4% 68/logcat: 0.2% user + 0.1% kernel / faults: 28 minor
09-22 08:52:31.727: ERROR/ActivityManager(69):   0.2% 13/kswapd0: 0% user + 0.2% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):   0.1% 1//init: 0.1% user + 0% kernel / faults: 1 minor
09-22 08:52:31.727: ERROR/ActivityManager(69):   0.1% 27/servicemanager: 0% user + 0.1% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):   0.1% 124/com.android.phone: 0.1% user + 0% kernel / faults: 133 minor
09-22 08:52:31.727: ERROR/ActivityManager(69):  +0% 276/com.google.process.gapps: 0% user + 0% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69): 100% TOTAL: 56% user + 43% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69): CPU usage from 2942ms to 3722ms later:
09-22 08:52:31.727: ERROR/ActivityManager(69):   40% 69/system_server: 18% user + 22% kernel / faults: 353 minor 5 major
09-22 08:52:31.727: ERROR/ActivityManager(69):     19% 82/ActivityManager: 11% user + 8.6% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     6.1% 160/Binder Thread #: 4.9% user + 1.2% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     6.1% 203/Binder Thread #: 4.9% user + 1.2% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     3.7% 70/HeapWorker: 0% user + 3.7% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     2.4% 161/Binder Thread #: 0% user + 2.4% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     2.4% 194/Thread-50: 0% user + 2.4% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     2.4% 245/Binder Thread #: 0% user + 2.4% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     1.2% 69/system_server: 0% user + 1.2% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     1.2% 88/PackageManager: 0% user + 1.2% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     1.2% 133/GpsLocationProv: 1.2% user + 0% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     1.2% 196/Binder Thread #: 0% user + 1.2% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     1.2% 202/Binder Thread #: 0% user + 1.2% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     1.2% 234/Binder Thread #: 1.2% user + 0% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     1.2% 241/Binder Thread #: 0% user + 1.2% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     1.2% 242/Binder Thread #: 0% user + 1.2% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):   11% 212/android.process.media: 7.5% user + 4.3% kernel / faults: 409 minor 3 major
09-22 08:52:31.727: ERROR/ActivityManager(69):     9.6% 231/Binder Thread #: 6.4% user + 3.2% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     1% 229/Binder Thread #: 0% user + 1% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     1% 265/MediaScannerSer: 1% user + 0% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):    +0% 288/Binder Thread #: 0% user + 0% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):   12% 276/com.google.process.gapps: 10% user + 1.2% kernel / faults: 132 minor 1 major
09-22 08:52:31.727: ERROR/ActivityManager(69):     8.4% 276/e.process.gapps: 7.2% user + 1.2% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     1.2% 281/Compiler: 1.2% user + 0% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     1.2% 286/AsyncTask #1: 1.2% user + 0% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):    +0% 289/pool-1-thread-1: 0% user + 0% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):   7.6% 119/com.android.inputmethod.latin: 4.3% user + 3.2% kernel / faults: 215 minor 3 major
09-22 08:52:31.727: ERROR/ActivityManager(69):     3.2% 167/AsyncTask #2: 1% user + 2.1% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     2.1% 168/AsyncTask #3: 2.1% user + 0% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     1% 166/AsyncTask #1: 1% user + 0% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     1% 170/AsyncTask #4: 1% user + 0% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):   6.3% 130/com.android.launcher: 4.2% user + 2.1% kernel / faults: 251 minor 5 major
09-22 08:52:31.727: ERROR/ActivityManager(69):     4.2% 130/ndroid.launcher: 4.2% user + 0% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     2.1% 165/launcher-loader: 0% user + 2.1% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     1% 163/Binder Thread #: 1% user + 0% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):   6.4% 186/android.process.acore: 2.1% user + 4.3% kernel / faults: 117 minor
09-22 08:52:31.727: ERROR/ActivityManager(69):     2.1% 211/ApplicationsPro: 0% user + 2.1% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     2.1% 248/Binder Thread #: 0% user + 2.1% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):     1% 201/Binder Thread #: 0% user + 1% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):   2.1% 126/com.android.systemui: 2.1% user + 0% kernel / faults: 37 minor
09-22 08:52:31.727: ERROR/ActivityManager(69):     2.1% 126/ndroid.systemui: 2.1% user + 0% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):   0.4% 27/servicemanager: 0% user + 0.4% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69):   1.1% 246/com.android.defcontainer: 1.1% user + 0% kernel / faults: 133 minor
09-22 08:52:31.727: ERROR/ActivityManager(69):     1.1% 262/Binder Thread #: 1.1% user + 0% kernel
09-22 08:52:31.727: ERROR/ActivityManager(69): 100% TOTAL: 55% user + 44% kernel
09-22 08:52:32.437: WARN/dalvikvm(186): threadid=4: spin on suspend #1 threadid=9 (pcf=0)
09-22 08:52:32.437: DEBUG/dalvikvm(186): Temporarily moving tid 211 to fg (was 0)
09-22 08:52:32.447: DEBUG/dalvikvm(186): Temporarily raised priority on tid 211 (10 -> 0)
09-22 08:52:32.487: WARN/dalvikvm(186): threadid=4: spin on suspend resolved in 1054 msec
09-22 08:52:32.487: DEBUG/dalvikvm(186): Restored policy of 211 to 0
09-22 08:52:32.487: DEBUG/dalvikvm(186): Restored priority on 211 to 10
09-22 08:52:32.637: INFO/dalvikvm(186): Wrote stack traces to '/data/anr/traces.txt'
09-22 08:52:33.858: INFO/dalvikvm(130): Wrote stack traces to '/data/anr/traces.txt'
09-22 08:52:33.858: INFO/ActivityManager(69): Displayed com.android.launcher/com.android.launcher2.Launcher: +1m3s537ms
09-22 08:52:34.057: INFO/ActivityThread(291): Pub com.android.email.provider: com.android.email.provider.EmailProvider
09-22 08:52:34.107: INFO/ActivityThread(291): Pub com.android.email.attachmentprovider: com.android.email.provider.AttachmentProvider
09-22 08:52:34.117: INFO/ActivityThread(291): Pub com.android.exchange.provider: com.android.exchange.provider.ExchangeProvider
09-22 08:52:34.777: DEBUG/EAS SyncManager(291): !!! EAS SyncManager, onCreate
09-22 08:52:35.717: INFO/ActivityManager(69): Start proc com.android.deskclock for broadcast com.android.deskclock/.AlarmInitReceiver: pid=306 uid=10026 gids={}
09-22 08:52:36.647: INFO/ActivityThread(306): Pub com.android.deskclock: com.android.deskclock.AlarmProvider
09-22 08:52:36.757: DEBUG/Eas Debug(291): Logging:
09-22 08:52:36.887: DEBUG/EAS SyncManager(291): !!! EAS SyncManager, onDestroy
09-22 08:52:36.947: INFO/ActivityManager(69): Process android.process.acore (pid 186) has died.
09-22 08:52:36.957: INFO/ActivityManager(69): Low Memory: No more background processes.
09-22 08:52:37.257: INFO/ActivityManager(69): Start proc com.android.quicksearchbox for broadcast com.android.quicksearchbox/.SearchWidgetProvider: pid=319 uid=10008 gids={3003}
09-22 08:52:38.247: INFO/ActivityManager(69): Process com.android.deskclock (pid 306) has died.
09-22 08:52:38.247: INFO/ActivityManager(69): Low Memory: No more background processes.
09-22 08:52:38.327: INFO/ActivityThread(319): Pub com.android.quicksearchbox.google: com.android.quicksearchbox.google.GoogleSuggestionProvider
09-22 08:52:38.397: INFO/ActivityThread(319): Pub com.android.quicksearchbox.shortcuts: com.android.quicksearchbox.ShortcutsProvider
09-22 08:52:38.698: INFO/ActivityManager(69): Start proc com.android.protips for broadcast com.android.protips/.ProtipWidget: pid=327 uid=10009 gids={}
09-22 08:52:39.647: INFO/ActivityManager(69): Process com.android.quicksearchbox (pid 319) has died.
09-22 08:52:39.647: INFO/ActivityManager(69): Low Memory: No more background processes.
09-22 08:52:39.996: WARN/ActivityManager(69): No content provider found for:
09-22 08:52:40.576: DEBUG/Email(291): BOOT_COMPLETED
09-22 08:52:40.817: DEBUG/EAS SyncManager(291): !!! EAS SyncManager, onCreate
09-22 08:52:40.856: DEBUG/EAS SyncManager(291): !!! EAS SyncManager, onStartCommand
09-22 08:52:40.966: DEBUG/EAS SyncManager(291): !!! EAS SyncManager, stopping self
09-22 08:52:40.986: DEBUG/EAS SyncManager(291): !!! EAS SyncManager, onDestroy
09-22 08:52:41.036: INFO/ActivityManager(69): Process com.android.email (pid 291) has died.
09-22 08:52:41.036: INFO/ActivityManager(69): Low Memory: No more background processes.
09-22 08:52:41.406: INFO/ActivityManager(69): Start proc com.android.music for broadcast com.android.music/.MediaAppWidgetProvider: pid=336 uid=10015 gids={3003, 1015}
09-22 08:52:42.028: WARN/ActivityManager(69): No content provider found for:
09-22 08:52:42.566: INFO/ActivityManager(69): Process com.android.defcontainer (pid 246) has died.
09-22 08:52:42.946: INFO/ActivityManager(69): Start proc com.android.deskclock for broadcast com.android.deskclock/.AlarmInitReceiver: pid=345 uid=10026 gids={}
09-22 08:52:42.986: DEBUG/PackageParser(69): Scanning package: /data/app/vmdl-1815643067.tmp
09-22 08:52:44.316: DEBUG/MediaScanner(212):  prescan time: 4477ms
09-22 08:52:44.326: DEBUG/MediaScanner(212):     scan time: 119ms
09-22 08:52:44.326: DEBUG/MediaScanner(212): postscan time: 1ms
09-22 08:52:44.326: DEBUG/MediaScanner(212):    total time: 4597ms
09-22 08:52:44.606: DEBUG/dalvikvm(130): GC_EXTERNAL_ALLOC freed 313K, 51% free 2938K/5895K, external 4417K/4423K, paused 212ms
09-22 08:52:44.906: INFO/PackageManager(69): Removing non-system package:tesi.android
09-22 08:52:45.556: DEBUG/PackageManager(69): Scanning package tesi.android
09-22 08:52:45.556: INFO/PackageManager(69): Package tesi.android codePath changed from /data/app/tesi.android-1.apk to /data/app/tesi.android-2.apk; Retaining data and using new
09-22 08:52:45.576: INFO/PackageManager(69): Unpacking native libraries for /data/app/tesi.android-2.apk
09-22 08:52:45.646: DEBUG/installd(34): DexInv: --- BEGIN '/data/app/tesi.android-2.apk' ---
09-22 08:52:46.326: DEBUG/dalvikvm(353): DexOpt: load 116ms, verify+opt 66ms
09-22 08:52:46.346: DEBUG/installd(34): DexInv: --- END '/data/app/tesi.android-2.apk' (success) ---
09-22 08:52:46.357: WARN/PackageManager(69): Code path for pkg : tesi.android changing from /data/app/tesi.android-1.apk to /data/app/tesi.android-2.apk
09-22 08:52:46.357: WARN/PackageManager(69): Resource path for pkg : tesi.android changing from /data/app/tesi.android-1.apk to /data/app/tesi.android-2.apk
09-22 08:52:46.366: DEBUG/PackageManager(69):   Activities: tesi.android.Act
09-22 08:52:46.606: DEBUG/dalvikvm(130): GC_EXPLICIT freed 78K, 51% free 2910K/5895K, external 5062K/5293K, paused 72ms
09-22 08:52:46.906: INFO/installd(34): move /data/dalvik-cache/data@app@tesi.android-2.apk@classes.dex -> /data/dalvik-cache/data@app@tesi.android-2.apk@classes.dex
09-22 08:52:46.906: DEBUG/PackageManager(69): New package installed in /data/app/tesi.android-2.apk
09-22 08:52:46.926: WARN/PackageManager(69): Unknown permission android.permission.ACCESS_GPS in package tesi.android
09-22 08:52:46.926: WARN/PackageManager(69): Unknown permission android.permission.ACCESS_LOCATION in package tesi.android
09-22 08:52:47.436: DEBUG/dalvikvm(69): GC_CONCURRENT freed 1327K, 47% free 4650K/8647K, external 4396K/5596K, paused 27ms+31ms
09-22 08:52:47.837: INFO/ActivityManager(69): Process com.android.protips (pid 327) has died.
09-22 08:52:47.866: INFO/ActivityManager(69): Force stopping package tesi.android uid=10037
09-22 08:52:47.866: INFO/ActivityManager(69): Process com.android.music (pid 336) has died.
09-22 08:52:47.876: INFO/ActivityManager(69): Low Memory: No more background processes.
09-22 08:52:47.876: INFO/ActivityManager(69): Force stopping package tesi.android uid=10037
09-22 08:52:48.056: DEBUG/MediaScannerService(212): done scanning volume internal
09-22 08:52:48.157: INFO/ActivityManager(69): Force stopping package tesi.android uid=10037
09-22 08:52:48.407: INFO/ActivityThread(345): Pub com.android.deskclock: com.android.deskclock.AlarmProvider
09-22 08:52:49.067: WARN/RecognitionManagerService(69): no available voice recognition services found
09-22 08:52:50.157: DEBUG/dalvikvm(69): GC_EXPLICIT freed 452K, 48% free 4518K/8647K, external 4396K/5596K, paused 157ms
09-22 08:52:50.390: INFO/installd(34): unlink /data/dalvik-cache/data@app@tesi.android-1.apk@classes.dex
09-22 08:52:50.697: DEBUG/AndroidRuntime(206): Shutting down VM
09-22 08:52:50.797: DEBUG/dalvikvm(206): GC_CONCURRENT freed 100K, 72% free 293K/1024K, external 0K/0K, paused 2ms+2ms
09-22 08:52:50.807: INFO/AndroidRuntime(206): NOTE: attach of thread 'Binder Thread #3' failed
09-22 08:52:50.817: INFO/ActivityManager(69): Process android.process.media (pid 212) has died.
09-22 08:52:50.877: DEBUG/jdwp(206): adbd disconnected
09-22 08:52:51.197: INFO/ActivityManager(69): Start proc android.process.media for broadcast com.android.providers.downloads/.DownloadReceiver: pid=358 uid=10017 gids={1015, 1006, 2001, 3003}
09-22 08:52:51.668: DEBUG/dalvikvm(276): GREF has increased to 201
09-22 08:52:52.987: DEBUG/dalvikvm(276): GC_CONCURRENT freed 1255K, 58% free 2875K/6727K, external 1634K/2137K, paused 9ms+39ms
09-22 08:52:54.788: INFO/ActivityThread(358): Pub media: com.android.providers.media.MediaProvider
09-22 08:52:55.047: DEBUG/AndroidRuntime(364): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
09-22 08:52:55.047: DEBUG/AndroidRuntime(364): CheckJNI is ON
09-22 08:52:55.137: VERBOSE/MediaProvider(358): Attached volume: internal
09-22 08:52:56.517: INFO/ActivityThread(358): Pub downloads: com.android.providers.downloads.DownloadProvider
09-22 08:52:56.707: INFO/ActivityThread(358): Pub drm: com.android.providers.drm.DrmProvider
09-22 08:52:57.237: INFO/ActivityManager(69): Start proc com.android.music for broadcast com.android.music/.MediaAppWidgetProvider: pid=381 uid=10015 gids={3003, 1015}
09-22 08:52:58.167: DEBUG/dalvikvm(32): GC_EXPLICIT freed 11K, 53% free 2538K/5379K, external 1625K/2137K, paused 893ms
09-22 08:52:58.357: DEBUG/dalvikvm(32): GC_EXPLICIT freed <1K, 53% free 2538K/5379K, external 1625K/2137K, paused 190ms
09-22 08:52:58.617: DEBUG/dalvikvm(32): GC_EXPLICIT freed <1K, 53% free 2538K/5379K, external 1625K/2137K, paused 237ms
09-22 08:52:59.487: DEBUG/AndroidRuntime(364): Calling main entry com.android.commands.am.Am
09-22 08:52:59.897: INFO/ActivityManager(69): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=tesi.android/.Act } from pid 364
09-22 08:53:00.307: INFO/ActivityManager(69): Process com.android.deskclock (pid 345) has died.
09-22 08:53:00.307: INFO/ActivityManager(69): Low Memory: No more background processes.
09-22 08:53:00.357: DEBUG/AndroidRuntime(364): Shutting down VM
09-22 08:53:00.427: INFO/AndroidRuntime(364): NOTE: attach of thread 'Binder Thread #3' failed
09-22 08:53:00.457: INFO/ActivityManager(69): Start proc tesi.android for activity tesi.android/.Act: pid=392 uid=10037 gids={3003}
09-22 08:53:00.477: DEBUG/dalvikvm(364): GC_CONCURRENT freed 103K, 69% free 319K/1024K, external 0K/0K, paused 2ms+1ms
09-22 08:53:00.537: DEBUG/jdwp(364): Got wake-up signal, bailing out of select
09-22 08:53:00.537: DEBUG/dalvikvm(364): Debugger has detached; object registry had 1 entries
09-22 08:53:01.937: INFO/ActivityManager(69): Start proc com.android.protips for broadcast com.android.protips/.ProtipWidget: pid=402 uid=10009 gids={}
09-22 08:53:02.157: INFO/gc(392): :android.location.Geocoder@405185a8
09-22 08:53:02.197: INFO/lat(392): :null
09-22 08:53:02.197: INFO/lon(392): :null
09-22 08:53:03.567: INFO/ActivityManager(69): Start proc com.android.quicksearchbox for broadcast com.android.quicksearchbox/.SearchWidgetProvider: pid=410 uid=10008 gids={3003}
09-22 08:53:03.678: INFO/ActivityManager(69): Displayed tesi.android/.Act: +3s345ms
09-22 08:53:05.597: INFO/ActivityManager(69): Process com.android.music (pid 381) has died.
09-22 08:53:05.657: INFO/ActivityThread(410): Pub com.android.quicksearchbox.google: com.android.quicksearchbox.google.GoogleSuggestionProvider
09-22 08:53:05.747: INFO/ActivityThread(410): Pub com.android.quicksearchbox.shortcuts: com.android.quicksearchbox.ShortcutsProvider
09-22 08:53:05.917: INFO/ActivityManager(69): Start proc com.svox.pico for broadcast com.svox.pico/.VoiceDataInstallerReceiver: pid=418 uid=10010 gids={}
09-22 08:53:06.787: INFO/ActivityThread(418): Pub com.svox.pico.providers.SettingsProvider: com.svox.pico.providers.SettingsProvider
09-22 08:53:06.956: INFO/ActivityManager(69): Start proc com.google.android.apps.maps:FriendService for broadcast com.google.android.apps.maps/com.google.googlenav.friend.android.ServiceReceiver: pid=427 uid=10018 gids={3003, 1015}
09-22 08:53:06.977: INFO/ActivityManager(69): Process com.android.protips (pid 402) has died.
09-22 08:53:08.436: INFO/ActivityManager(69): Process com.android.quicksearchbox (pid 410) has died.
09-22 08:53:09.886: INFO/ActivityManager(69): Start proc com.android.quicksearchbox for broadcast com.android.quicksearchbox/.CorporaUpdateReceiver: pid=437 uid=10008 gids={3003}
09-22 08:53:10.917: INFO/ActivityManager(69): Process com.google.android.apps.maps:FriendService (pid 427) has died.
09-22 08:53:11.027: INFO/ActivityThread(437): Pub com.android.quicksearchbox.google: com.android.quicksearchbox.google.GoogleSuggestionProvider
09-22 08:53:11.076: INFO/ActivityThread(437): Pub com.android.quicksearchbox.shortcuts: com.android.quicksearchbox.ShortcutsProvider
09-22 08:53:16.747: DEBUG/skia(126): purging 27K from font cache [4 entries]
09-22 08:53:16.928: DEBUG/dalvikvm(126): GC_EXPLICIT freed 149K, 52% free 2715K/5639K, external 2110K/2137K, paused 177ms
09-22 08:53:21.767: DEBUG/skia(124): purging 6K from font cache [1 entries]
09-22 08:53:21.877: DEBUG/dalvikvm(124): GC_EXPLICIT freed 153K, 50% free 2905K/5767K, external 1625K/2137K, paused 102ms
09-22 08:53:22.617: INFO/InputReader(69): Device reconfigured: id=0x0, name=qwerty2, display size is now 480x800
09-22 08:53:22.617: INFO/InputManager-Callbacks(69): No virtual keys found for device qwerty2.
09-22 08:53:24.258: INFO/ARMAssembler(69): generated scanline__00000077:03515104_00001004_00000000 [ 65 ipp] (85 ins) at [0x444b0520:0x444b0674] in 9420691 ns
09-22 08:53:24.397: INFO/ARMAssembler(69): generated scanline__00000177:03515104_00001001_00000000 [ 91 ipp] (114 ins) at [0x444b0678:0x444b0840] in 1250674 ns
09-22 08:53:28.747: DEBUG/skia(119): purging 6K from font cache [1 entries]
09-22 08:53:28.838: DEBUG/dalvikvm(119): GC_EXPLICIT freed 66K, 52% free 2726K/5639K, external 2585K/2773K, paused 89ms
09-22 08:53:33.807: DEBUG/skia(130): purging 84K from font cache [11 entries]
09-22 08:53:34.397: DEBUG/dalvikvm(130): GC_EXPLICIT freed 102K, 50% free 2977K/5895K, external 4787K/5293K, paused 584ms
09-22 08:53:38.838: DEBUG/skia(69): purging 175K from font cache [17 entries]
09-22 08:53:38.996: DEBUG/dalvikvm(69): GC_EXPLICIT freed 1167K, 48% free 4511K/8647K, external 4396K/5596K, paused 155ms
Simo :)

Offline AriTiAdoro

  • Utente junior
  • **
  • Post: 98
  • Da soli non si va da nessuna parte!!
  • Respect: +1
    • Mostra profilo
  • Sistema operativo:
    Windows 7
Re:visualizzare luogo su mappa
« Risposta #5 il: 22 Settembre 2011, 11:00:41 CEST »
0
Quegli errori non li ho mai visti.. riguardano l'uso della CPU? Non capisco..
Simo :)

Offline Verandi

  • Utente normale
  • ***
  • Post: 378
  • Respect: +75
    • Mostra profilo
  • Sistema operativo:
    Windows 7
Re:visualizzare luogo su mappa
« Risposta #6 il: 22 Settembre 2011, 11:25:12 CEST »
0


Edit: guardando meglio, low memory e rallentamento sono relative ad altro, il problema sono le permission sbagliate. :)
« Ultima modifica: 22 Settembre 2011, 11:28:32 CEST da Verandi »

Offline AriTiAdoro

  • Utente junior
  • **
  • Post: 98
  • Da soli non si va da nessuna parte!!
  • Respect: +1
    • Mostra profilo
  • Sistema operativo:
    Windows 7
Re:visualizzare luogo su mappa
« Risposta #7 il: 22 Settembre 2011, 11:41:46 CEST »
0
Codice (Java): [Seleziona]
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="tesi.android"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="9" />

  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
   
    <uses-permission android:name="android.permission.ACCESS_LOCATION" />
   



    <application android:icon="@drawable/icon" android:label="@string/app_name">
     <uses-library android:name="com.google.android.maps" />
        <activity android:name=".Act"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
       
       

    </application>
   
   
</manifest>


Ho modificato il manifest cosi. MI da gli stessi problemi. Sono abbastanza sul disperato!
Simo :)

Offline Verandi

  • Utente normale
  • ***
  • Post: 378
  • Respect: +75
    • Mostra profilo
  • Sistema operativo:
    Windows 7
Re:visualizzare luogo su mappa
« Risposta #8 il: 22 Settembre 2011, 11:43:35 CEST »
0
Dovresti togliere anche ACCESS_LOCATION perché non esiste.  ;-)

Offline AriTiAdoro

  • Utente junior
  • **
  • Post: 98
  • Da soli non si va da nessuna parte!!
  • Respect: +1
    • Mostra profilo
  • Sistema operativo:
    Windows 7
Re:visualizzare luogo su mappa
« Risposta #9 il: 22 Settembre 2011, 14:24:06 CEST »
0
Non funziona ugualmente..ma il problema credo che sia qui:


  Geocoder gc = new Geocoder(Act.this, Locale.getDefault());
  List<Address> addressList = gc.getFromLocationName(streetAdress,1);



perchè se stampo addressList.size()    mi restituisce 0.......
Simo :)

Offline Verandi

  • Utente normale
  • ***
  • Post: 378
  • Respect: +75
    • Mostra profilo
  • Sistema operativo:
    Windows 7
Re:visualizzare luogo su mappa
« Risposta #10 il: 22 Settembre 2011, 14:40:06 CEST »
0
Ma ti appare anche il dialog del force close? Ci sono altri errori nel log? Se non è così, allora dovresti provare quello che ha citato Teskio.

Offline AriTiAdoro

  • Utente junior
  • **
  • Post: 98
  • Da soli non si va da nessuna parte!!
  • Respect: +1
    • Mostra profilo
  • Sistema operativo:
    Windows 7
Re:visualizzare luogo su mappa
« Risposta #11 il: 22 Settembre 2011, 14:51:01 CEST »
0
no il force close non mi appare.Il problema forse è quello che ti ho detto prima,cioè che non so perchè non mi istanzia l'oggetto Geocoder...perchè poi sull'arrayList mi da lunghezza 0...
Se io faccio

Geocoder gc = new Geocoder(Act.this);

Act.this mi restituisce il contesto corrente? Perchè mi era venuto il dubbio che fosse quello
Simo :)

Offline Verandi

  • Utente normale
  • ***
  • Post: 378
  • Respect: +75
    • Mostra profilo
  • Sistema operativo:
    Windows 7
Re:visualizzare luogo su mappa
« Risposta #12 il: 22 Settembre 2011, 14:57:44 CEST »
0
Sì, anche se comunque puoi tranquillamente passare il l'istanza this e basta se è come nel codice che hai postato.
Al 99% il tuo codice mi sembra tutto giusto quindi, o è un problema di connessione (a me capitava di avere una lista vuota se la latenza della connessione era davvero molto alta), oppure è il problema che descrive Teskio: manca il servizio. Basta che tu faccia un check con gc.isPresent() per controllare che il problema non sia quello.

Offline AriTiAdoro

  • Utente junior
  • **
  • Post: 98
  • Da soli non si va da nessuna parte!!
  • Respect: +1
    • Mostra profilo
  • Sistema operativo:
    Windows 7
Re:visualizzare luogo su mappa
« Risposta #13 il: 22 Settembre 2011, 15:22:35 CEST »
0
Eh... il servizio c'e.. e  in effetti ci mette una vita a caricare l'Activity.. ma come mai? è Geocoder che la fa andare cosi lenta?
Quindi come pensi posso risolvere il problema? cmq grazie per tutte le risposte che mi stai dando!!
Simo :)

Offline Verandi

  • Utente normale
  • ***
  • Post: 378
  • Respect: +75
    • Mostra profilo
  • Sistema operativo:
    Windows 7
Re:visualizzare luogo su mappa
« Risposta #14 il: 22 Settembre 2011, 15:32:42 CEST »
0
Allora mi sa che il problema della lista vuota sia la connessione. Hai modo di controllare con una connessione veloce?
Per il rallentamento dell'activity, a meno che non ci siano altre operazioni lunghe, il problema è il geocoder. Bisogna metterlo in un thread separato, magari con un'asyncTask.   ;-)