Good day! When writing an application using Yandex.Maps , I ran into a portability issue on different versions of the platform.

Initially, I started writing on android 2.1 version, as I naively thought that it would work on older versions. I always started to check on the emulator with android 2.1 and on a friend’s phone with android 2.2 everything worked well, the other day I tried to run on android 2.3 (tablet) and then I had problems starting, I refused to open even Only the cards worked, the rest was all started. Tablet with android 3.0 opens, but sometimes the application crashes.

Tell me, can someone come across a similar problem, or someone knows where to drip.

  • It is necessary to remove the log and watch. Nobody will give another recipe. - KoVadim

1 answer 1

Most likely due to the fact that the application requires telephone or other functions. Explicitly list in the manifest:

<uses-feature android:name="android.hardware.telephony" android:required="false"/> <uses-feature android:name="android.hardware.camera" android:required="false"/> <uses-feature android:name="android.hardware.touchscreen" android:required="false"/> 

In my opinion, the presence of telephone functions is required by default (I can be mistaken) - therefore, write down their explicit rejection. But if the code uses telephone functions, then it is more difficult - although it can also be solved through reflection.

The second possible reason is a problem with support for large screens (although it is unrealistic). But just in case, write in the manifest support for all screens:

 <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" /> <compatible-screens> <screen android:screenSize="small" android:screenDensity="ldpi"/> <screen android:screenSize="small" android:screenDensity="mdpi"/> <screen android:screenSize="small" android:screenDensity="hdpi"/> <screen android:screenSize="small" android:screenDensity="xhdpi"/> <screen android:screenSize="normal" android:screenDensity="ldpi"/> <screen android:screenSize="normal" android:screenDensity="mdpi"/> <screen android:screenSize="normal" android:screenDensity="hdpi"/> <screen android:screenSize="normal" android:screenDensity="xhdpi"/> <screen android:screenSize="large" android:screenDensity="ldpi"/> <screen android:screenSize="large" android:screenDensity="mdpi"/> <screen android:screenSize="large" android:screenDensity="hdpi"/> <screen android:screenSize="large" android:screenDensity="xhdpi"/> <screen android:screenSize="xlarge" android:screenDensity="ldpi"/> <screen android:screenSize="xlarge" android:screenDensity="mdpi"/> <screen android:screenSize="xlarge" android:screenDensity="hdpi"/> <screen android:screenSize="xlarge" android:screenDensity="xhdpi"/> </compatible-screens> 

And finally, the 3rd reason: compile under 2.3 with a declaration of support for lower versions:

 <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="10"/> 

I once had a lot of trouble and eventually came to such modifications.