get location on android sdk - android-emulator

I am very new to android.I am using android 2.3.I want to know how to get location through gps or network provider on the android emulator.When I run my application on the emulator,it does not give me the name of the network provider but displays "network".I am creating an application which requires user's current location.
can anyone please help me to do it and even how i can test if it works on emulator.

Two parts
Emulator will not give you a location. However, you can simulate a location. If you are using Eclipse, go to DDMS perspective and in the left side, you will see Emulator Controls. Scroll down to see Location Controls. You can enter location coords here.
You need to download Google API for Android (This is different from Android API). Go to your Android SDK and AVD Manager (in Eclipse this is under Menu 'Window'). Select Available Packages --> Third party Add-Ons --> Google Inc and select the API versions you want. Run the GPS emulation using these emulator

Related

Can I make Roku app using flutter? if I Can how can I run

I want to make a Roku app using flutter but don't know how can i run Roku app in flutter using android studio
Unfortunately no.
The only similarity Roku has with Android is Linux in its roots :)
To make Flutter work for Roku, you will need at least to add the possibility to display Skia canvas on the platform. To do so, most likely you will need NDK because BrightScript is poor for such purposes.
When I was working with Roku, NDK was not in public access, you had to write them directly via email to ask for it. And if Flutter SDK for Roku exists, you will still need to ask Roku to use NDK in your app because you will need it at least to initialize the project.
So yes, if one day an initiative exists, both Flutter and Roku teams will need to make efforts to make this idea alive. Btw, there is a request for Roku support to the Flutter team created in 2019: https://github.com/flutter/flutter/issues/37159

can i create android and ios applications with flutter without android emulator , with just flutter sdk and vscode and browser

I learned dart and I want to access flutter, but I was surprised by android studio because my computer is weak.so,can i create android and apple applications with flutter without android emulator , with just flutter pack and vs code and browser
If you only work with simple UI widgets yes you can use the embedded development tools within the browser to get the dimensions of the device you working on like so
But, most of the cases there are libraries work differently according to the platform so it might work with the web but not with android or iphone and you can not test it without the actual device.
And yes VS code is a very good with flutter and might be better than android studio but it won`t make the difference you expected, in my opinion what make it faster is to use an actual device for testing and not using the emulator, also don't use a lot of application along side with the IDE, like if you are using spotify, listening to youtube video or following a tutorial just use your phone because browsers as bad as emulator.
You can use a text editor and the command line tools to build flutter apps and test them on a real device.
I wouldn't recommend it though.
You could give VSCode a try as it is a more lightweight environment.
Your computer should handle testing on a real device, which requires only a USB cable. Accessing the application in the browser would probably eat a lot more memory. You can read about how to use the real device with flutter here.

Hololens Spectator View Android Spatial Failure

I need to connect an Android device to a Hololens for 'spectator' viewing as in the sample 'Build 2019 Demo' code. However when I launch the Android and Hololens builds and enter the Hololens IP address on the Android side, all I see is an 'ArUco' code. No video and no 3D content are visible on the android device.
I should add that I have painstakingly reviewed the sample project as compared to my project and cannot determine any relevant differences.
Naturally, I want to get past this screen-code, but I am also confused about where this ArUco code exists in the application flow as it isn't part of any scene (or flow)that I am aware of.
The ArUco code is appearing in order to localize the two devices. If everything is compiled correctly, the HoloLens will start using its camera to detect the ArUco code. Once its detected, the ArUco code will be dismissed and content will be positioned correctly across the two devices. It may be that you are missing the OpenCV native plugins required for ArUco marker detection. Instructions on how to build those plugins can be found here. You specifically need an x86 version of SpectatorView.OpenCV.dll for ArUco detection to work on a HoloLens 1 device.
The Build2019 sample uses Azure Spatial Anchors compared to ArUco markers for localization. If you want to use Azure Spatial Anchors, you need to go to Spectator View -> Edit Settings and Add a SpatialAnchorsCoordinateLocalizationInitializer to the prefab. You also need to declare in the SpatialLocalizationInitializationSettings a Prioritized Initializer that references this SpatialAnchorsCoordinateLocalizationInitializer. This will cause the SpatialAnchorsCoordinateLocalizationInitializer to be used compared to the default ArUco localization initializer.
If you have set up these settings, it may be that the SpatialAnchorsLocalizer isn't registering as available on your Android or HoloLens device. You need to add the SPATIALALIGNMENT_ASA preprocessor directive to your Android and WSA Player Settings to get the SpatialAnchorsLocalizer to declare itself as supported.

I cannot see my app when I debug my project on smartface free

I have installed the free version of smartface and just created a training project. When I build it my app install on virtual android device but I cannot see it. I just see the smartface adverts.
What can I do to solve this problem? Should I get it lisenced?
I didn't get your problem exactly, can you please share a screenshot?
And maybe you can check the link below for more information about Android virtual device usage :
http://www.smartface.io/developer/guides/project/virtual-devices-android/
By the way, you should create the virtual device using google api.
The screen that you mentioned is just shown at the beginning of the app for some seconds. Then you can see your application page and use it. You should reinstall it on a real android device.

Android 2.2: Where is the option for speech input in the emulator?

My Nexus One has it:
Settings includes a "Voice
recognizer settings" in the list of
"Voice input & output settings".
Google Search has a microphone
button next to it, so when I touch
it, a dialog prompts me to say what
I want to search.
On the emulator (API level 8, Android 2.2) however, any of the above is nowhere to be found.
Isn't voice search part of Android 2.2? If so, why is it found on my Nexus One (Froyo) but not on the emulator?
What do I need to do to make at least the "Voice input & output settings" available?
Update 1: I followed the instructions for creating the recognizer-enabled AVD as suggested below, but I still receive the "Recognizer no present" message:
What else do I need to do?
Is it possible that despite installing Google APIs by Google Inc., Android API 8, revision 2 and creating a special AVD with it, I still need to install the Voice Search app from the Android Market?
Update 2: I followed Michael's correction to install Google's Voice Search app. This solved the "Recognizer no present" problem but now I am presented with a new problem:
The app's suggestion "Speak again" is bogus: Speaking again presents the same error message over and over again.
In your emulator image, can you install Google Voice Search as in Converting speech to text. The app is in the marketplace at https://market.android.com/details?id=com.google.android.voicesearch&feature=search_result. I think this is the only way to add the Recognizer Intent. Recognizer is not part of the base Android, it is considered an additional component that ships with Google Voice Search and is included in some phones.
I thought that including the Google APIs in your emulator target image would work, but it appears that I was mistaken. I thought you needed to build the target to include "Google APIs" since this capability is not core android, but an additional Google feature.