Up to API 29 tts is working fine on android to speak out any text
But on API 30 tts is not working anymore and i do not know why
The google documentation says :
"Apps targeting Android 11 that use text-to-speech should declare TextToSpeech.Engine#INTENT_ACTION_TTS_SERVICE in the elements of their manifest"
I do not exactly know what they mean and how to implement this in the manifest.
I hope anybody can help me with this.
Although probably not the best answer (or maybe just a glitch on Androids part) add the following code just above the <application in your manifest.
<queries>
<intent>
<action android:name="android.intent.action.TTS_SERVICE" />
</intent>
</queries>
<application
android:allowBackup="false"
After adding this code my TTS service started to work again, but I do get a warning from the manifest file about it not being allowed there, but anywhere in the manifest gives this same warning so I suppress it with <!--suppress AndroidElementNotAllowed --> just above the <manifest tag at the top.
#jayce's answer helps if app is targeting the Android 11
https://developer.android.com/reference/android/speech/tts/TextToSpeech
Note: sorry for the noise but I don't have enough reputation to put my comment there.
Related
I am working on an Android app and trying to implement Admob advertisement sdk. I have done everything that have been mentioned in the documentation but I am getting following error in red color in the black window which should have displayed advertisement.
You must have AdActivity declared in AndroidManifest.xml with ConfigChanges
I have added following line in AndroidManifest.xml:
<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation" />
I have tried but still I am not able to resolve this error. I am trying to run the application in my Xperia phone which has Android 4.0.4.
You need to put this in your manifest:
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
AdViews handle a lot of configuration changes themselves. The official documentation can be found here.
According to unify, Admob is now integrated into Google Play Services. A migration reference can be found here.
Updating the answer, the package has changed to:
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
Complete migration reference: https://developers.google.com/mobile-ads-sdk/docs/admob/play-migration
If you have still not solved this problem yet, I believe it is because you have to add some permissions for admob serves to serve ads to you
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Add these beneath the closing </Activity> tag
Hope this still helps
I'm trying to get AdMob in my android-app.
When i launch the emulator it says:
"you must have adactivity declared in androidmanifest.xml with configchanges"
There are a lot of topics about this but no one fixt the issue.
Please help me out!
Greetz, Jasper....
A proper Admob Activity in your AndroidManifest definition looks like this:
<!-- AdMobActivity definition -->
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
You are probably missing the android:configChanges part.
Note that all the configChanges parameters are required. Since not all of them exist/are allowed in older SDKS, you need to use a more recent Android version as your default build platform. You will still be able to target older Android versions if you set your minSdk properly and do not use any newer API calls in your code though.
What worked for me was to change the Android SDK version to 13 and expand the android:configChanges in the manifest to contain all parameters:
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
NOTE: The configChanges content is case-sensitive so make sure you preserve camelCase! (This bit me in the beginning)
I started receiving ad's within a minute or so.
a very good tutorial, here :
http://jmsliu.com/209/add-google-admob-in-android-application.html
Set your Build Target to latest you have (>=4) it will work.
You can still have minSdkVersion, targetSdkVersion as you like.
The ad will appear after a while, be patient :)
Hi all. This is my first post on StackOverflow, though I have been making use of this site for a several years. Usually I'm able to find an answer to any queries that I may have, by referring to questions that others have asked; however, in this case I am completely stumped, despite having done quite a bit of homework already
I am currently in the process of developing an Android application which is required to communicate with a piece of hardware - more specifically a PIC32 board - and display data that is returned by the board in real-time.
At present I have simply been using Eclipse and Android emulator for designing the interface and programming the backend of the application. And, I have now gotten to a stage where I would like to test the operation of the application on a physical Android device. However, whenever I attempt to install the application, directly from the phone (I send the .apk via Dropbox) I always get the error 'The application Package installer (process com.android.packageinstaller) has stopped unexpectedly. Please try again'. Now, I have done my homework and seemed to have determined that the error may lie in the Android Manifest file for the application. However, I just cannot see where this issue may be. I have seen other issues resolved by removing certain tags or replicated tags; however, even then my application does not want to install on my device, though it installs and works pretty much perfectly everytime when run through the emulator.
The application I am developing is based loosely on the Demo code provided by the hardware manufacturer. It has been appropriately modified. And, when I appropriately modified the Manifest file for my application and tested it with the demo application everything seemed to work fine on a physical device. So, something is telling me that the Manifest file may not actually be the issue. The key differences between my application and the demo application is that I have divided the code up into appropriate packages, such that one contains application code (activities) and the other contains code for communicating with the PIC32 board. I have also added an activity - the demo code only has one, but have two at present. The final difference is that I have defined a global object, for communicating with the board, that can be used by all of the application's activities. However, I don't believe that these would be the cause of this issue.
So again, the application seems to work fine on the emulator, but it simply does not want to install on a physical Android device - everytime I try to install I get an alert dialog box displaying this message.
I would very much appreciate any help and advice that anybody could provide, and thanks in advance.
Also, here is the Manifest file for the application I am developing:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tribosonics.android.TribosonicsApp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" >
</uses-sdk>
<uses-sdk android:targetSdkVersion="10" >
</uses-sdk>
<!--
<permissions>
<feature name="android.hardware.usb.accessory" />
<library
name="com.android.future.usb.accessory"
file="/system/framework/com.android.future.usb.accessory.jar" />
</permissions>
-->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:name=".GlobalAccessoryManager"
android:debuggable="true"
android:icon="#drawable/tribosonics_icon"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />
</intent-filter>
<meta-data
android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
android:resource="#xml/accessory_filter" />
<activity
android:name=".TribosonicsApp"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".SetScanPreferences"
android:screenOrientation="portrait" >
</activity>
<uses-library android:name="com.android.future.usb.accessory" />
</application>
</manifest>
android manifest, icon image is big so please reduce your image icon size and run the application it's working fine.
I saw this with the following exception in LogCat:
E/AndroidRuntime(28817): FATAL EXCEPTION: main
E/AndroidRuntime(28817): java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.example.app/.MyActivity } from ProcessRecord{487978e8 28817:com.android.packageinstaller/10063} (pid=28817, uid=10063) requires android.permission.ACCESS_FINE_LOCATION
I thought the problem was due to some <uses-permission...> tags in the manifest but in my case there was an android:permission="..." attribute in my manifests application tag which seemed to be causing the package manager to get the exception and barff. Deleting this got me going again.
change changing android:debuggable="true" to android:debuggable="false" and see if it makes any difference.
I am learning this via Sams Teach Yourself Android in 24 hours.
This is really strange, I run the app in the emulator and I get my splash screen (just some crappy text really) then I press the home button, and click on my app's icon and it gives me "Application is not installed on your phone"
I went into the emulators settings->applications and it's there!
I cleaned the project, uninstalled it from the emulator and re-ran it. Same damn problem.
(project is simple:
6activities, each has a unique text, as it starts it shows the splash activity
I have not even connected the other activities... just this)
You can download the entire source if you want at http://elxotica.com/TriviaQuiz.rar
Ok, got it working after going to the authors website, downloading the support code and going over it and comparing it line by line.
Basically in my manifest file I had
<activity android:name=".QuizSplashActivity"
android:label="#string/app_name">
and again below I had
<activity android:name="QuizSplashActivity"></activity>
which I thought was needed, but it looks like that should not be declared twice.
I fixed the problem but am not 100% sure of the cause :((
My problem was solved with this error when I moved the INTERNET permission statement in the manifest file out of the activity definition and into the application definition - that is, up in the hierarchy, right under the SDK version declaration:
<uses-sdk android:minSdkVersion="14" />
<uses-permission android:name="android.permission.INTERNET"/>
<application android:icon="#drawable/icon" blah blah
I also had the permission defined twice. Compiling did not find the bug, however, running the app on the Android emulator did. "Application not installed" is not very helpful, tho. Rather like, "You fowled up [and if you don't know why, I'm not telling you].
I have no problem to run it on Android 2.2 Virtual Device. Maybe you can try create new AVD and run it there. I´ve had similar problem with new update and creating new AVD solved it...
Yeah, I had the same problem.
Just don't declare QuizSplashActivity twice.
Helped in my project, grettz
Yet another failure mode with the same symptom. I had same permission twice, first like this:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
then like this:
<application android:icon="#drawable/icon" android:label="#string/app_name" android:permission="android.permission.WRITE_EXTERNAL_STORAGE">
The second one turns out not only not needed, but also cause the "Application not installed.." error.
So my application declaration looks like this now:
<application android:icon="#drawable/icon" android:label="#string/app_name">
And all is well in the world.
Same symptom, different cause. I'm not entirely certain what happened, but I will hazard a guess in case it helps anyone. What I know for sure: I deleted the icon, dragged it anew from Applications, problem solved.
At some point I changed which Activity was the entry-point (had android.intent.category.LAUNCHER & android.intent.action.MAIN)
I was trying to open the app using an icon on one of my "desktops", an icon which I had added before making the change in the manifest which changed which Activity was MAIN. So I'm guessing that the shortcut refers to the launcher activity and not the app (makes sense)...
My problem was missing assemblies in the package. But only on some phones.
I enabled "link all assemblies" option in the Xamarin studio and problem solved.
Android project options->Android build->Linker behavior->Link all assemblies.
[I'm using Xamarin studio with mono on Android.]
I'm trying to parse some html using jsoup (1.3.3) in my android activity. When I call this code
Jsoup.connect("http://www.google.com").get();
It works fine in android 2.1 and 2.2 but in 1.6 I get a "java.io.IOException: 403 Error loading URL".
I'm using the emulator to test this and I've noticed that admob ads are also not showing in 1.6 but they work in 2.0, 2.1 and 2.2.
Using the web browser in the 1.6 emulator does work so I'm pretty confident the problem is in my code somewhere.
Is there some extra permission I need for internet access in 1.6 that you don't need in 2.0+?
This is how my manifest file is structured, does the position of the uses-permission tag have any effect?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.foo.bar"
android:versionCode="1"
android:versionName="1.0"
android:installLocation="auto">
<application android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar"
android:name="blahblah"
android:description="#string/app_desc">
<activity android:label="#string/app_name" android:name=".activities.MainMenu">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.FullList" android:label="#string/app_name"/>
<!-- The application's publisher ID assigned by AdMob -->
<meta-data android:value="blahblahblah" android:name="ADMOB_PUBLISHER_ID" />
</application>
<uses-sdk android:minSdkVersion="4"/>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
</manifest>
I've tried creating a new project from scratch with just a hello world screen that uses the Jsoup.connect() method and that works fine on the same 1.6 emulator, so it must be a code problem but I can't figure it out.
JSOUP internally uses HttpURLConnection. Here is the line throwing exception.
The internet connection is OK (or else it would throw exception earlier) and you are getting a reply from server which is: 403 HTTP FORBIDDEN
Is there some kind of login in place? Do check that you can open the same URL in browser on the same device/emulator.
Try inserting /uses-sdk near the end of the script or try deleting /uses-permission with each surrounded with angle brackets
I've tried creating a new project from scratch with just a hello world screen that uses the Jsoup.connect() method and that works fine on the same 1.6 emulator, so it must be a code problem but I can't figure it out.
Try putting a test usage of this early in your application startup (or if that causes an ANR timeout, add a "test" button)
Make a copy of your application and comment a lot of things out
Somewhere between your minimal test which works and your full application which doesn't, there lies an important difference. Recursively divide the difference and conquer it...