[Android] FAQ, android
Here we summarize some common basic problems and solutions when using C # And VS2015 to develop Android apps. We will answer new questions here.
Question 1: The project cannot run normally. What is the problem?
[Answer]
Normally, after a simulator is selected, it will automatically start and deploy the program to the simulator.
If a problem occurs in a newly created project, it is generally caused by incorrect environment installation.
If the problem occurs after you write your own program, it is generally caused by improper configuration of the list.
In either case, you can follow the steps below to find an error.
(1) Check the project configuration
Main Menu --> Tools --> options --> Xamarin to check whether the environment configuration is correct. Note that the green options and check boxes on the following interface must be correct.
(2) check whether the version meets the requirements
Before debugging by pressing the <F5> key, make sure that the simulator you selected is consistent with your configuration.
View configuration list: In Solution Explorer, double-click the Properties folder. On the displayed project property configuration page, view the minimum version (item 2nd) whether it meets the Simulator version requirements you have started:
(3) Search for errors in the output window
Observe the output content in the output window after running to see if there is any error message.
Generally, you can see what the problem is from the output information in this output window.
If you still cannot find the problem, use logcat to view it (next step ).
(4) use logcat to view errors
After you click the shortcut key to start logcat, the following interface is displayed:
Click the Change Device shortcut to display the following interface:
This indicates that you have not started the simulator. At this time, make sure that you have selected a simulator when pressing the <F5> key:
Select the simulator and press the <F5> key to automatically start the simulator you selected.
If no simulator is available in this example, it indicates that your simulator has a problem.
(5) Check logcat output information
If you are an independently started simulator, rather than starting it by pressing the <F5> key, as shown in:
After the simulator you selected is started, run logcat again in step (4). You should see the following interface:
Select the simulator it finds, click OK, and then observe the output content:
(6) check whether the configuration in the list is correct.
Note the first line in the configuration file (AndroidManifest. xml:
<Manifest xmlns: android = "http://schemas.android.com/apk/res/android" package = "MyDemos. MyDemos" android: versionCode = "1" android: versionName = "1.0" android: installLocation = "auto">
This android: installLocation = "auto" indicates that if the corresponding. so file cannot be found, it will automatically install it on the simulator.
The above steps can solve the problem.
If you still cannot find the problem, please explain the steps in detail, or others will not understand what your problem is.
Question 2: How to copy files to the SD card of the simulator
[Problem description] Sometimes it is necessary to simulate files or programs downloaded by users through mobile phones on the simulator, such as copying music files or video files from the hard disk to the SD card of the simulator, is there a simple operation method?
[Answer]
The method is as follows:
1. Find the simulator file you created, for example:
C: \ Users \ User Name \. android \ avd \ Galaxy_Api19.avd \ sdcard. img
Or
C: \ Users \ User Name \. android \ avd \ Galaxy_Api23.avd \ sdcard. img
2. open the file with UltraISO or other virtual optical drive software, copy the file on the hard disk, paste it to the directory corresponding to the SD card in the file, for example, paste it to the Download folder, and save the file. imgfile.
Open the simulator and you will be able to see that these files already exist in the Download folder. The usage of these files is the same as that after you download the files to your mobile phone.