[Marble-devel] Review Request 124703: Adding TTS support to Marble Maps

Gábor Péterffy peterffy95 at gmail.com
Thu Aug 13 20:49:21 UTC 2015



> On Aug. 12, 2015, 3:13 p.m., Dennis Nienhüser wrote:
> > src/apps/marble-maps/package/src/org/kde/marble/maps/TextToSpeechClient.java, line 19
> > <https://git.reviewboard.kde.org/r/124703/diff/1/?file=393526#file393526line19>
> >
> >     Is this supposed to be a singleton? Then it's not implemented safely, m_instance would be overwritten when the next TextToSpeechClient() is created.
> >     Here's some discussion how to create a singleton in Java: http://stackoverflow.com/questions/70689/what-is-an-efficient-way-to-implement-a-singleton-pattern-in-java
> 
> Dennis Nienhüser wrote:
>     If the enum variant mentioned in the link is problematic to implement, number 2) in http://codebalance.blogspot.de/2010/08/singleton-pattern-and-beyond.html seems a good alternative.

Seems, we can not handle it as a singleton, because android.app.Instrumentation have to be able to instantiate it.

Here is the crash log:

 FATAL EXCEPTION: main
E/AndroidRuntime( 9294): Process: org.kde.marble.maps, PID: 9294
E/AndroidRuntime( 9294): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.kde.marble.maps/org.kde.marble.maps.TextToSpeechClient}: java.lang.IllegalAccessException: private org.kde.marble.maps.TextToSpeechClient() is not accessible from class android.app.Instrumentation
E/AndroidRuntime( 9294):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2240)
E/AndroidRuntime( 9294):        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2389)
E/AndroidRuntime( 9294):        at android.app.ActivityThread.access$900(ActivityThread.java:147)
E/AndroidRuntime( 9294):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1296)
E/AndroidRuntime( 9294):        at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 9294):        at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 9294):        at android.app.ActivityThread.main(ActivityThread.java:5254)
E/AndroidRuntime( 9294):        at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 9294):        at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 9294):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
E/AndroidRuntime( 9294):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
E/AndroidRuntime( 9294): Caused by: java.lang.IllegalAccessException: private org.kde.marble.maps.TextToSpeechClient() is not accessible from class android.app.Instrumentation
E/AndroidRuntime( 9294):        at java.lang.Class.newInstance(Class.java:1569)
E/AndroidRuntime( 9294):        at android.app.Instrumentation.newActivity(Instrumentation.java:1065)
E/AndroidRuntime( 9294):        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2230)
E/AndroidRuntime( 9294):        ... 10 more
W/ActivityManager(  779):   Force finishing activity org.kde.marble.maps/.TextToSpeechClient


- Gábor


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/124703/#review83738
-----------------------------------------------------------


On Aug. 13, 2015, 10:48 p.m., Gábor Péterffy wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/124703/
> -----------------------------------------------------------
> 
> (Updated Aug. 13, 2015, 10:48 p.m.)
> 
> 
> Review request for Marble.
> 
> 
> Repository: marble
> 
> 
> Description
> -------
> 
> Text to speech can be used from qml like this:
> textToSpeechClient.readText("Have a pleasant journey!");
> 
> 
> Diffs
> -----
> 
>   src/apps/marble-maps/CMakeLists.txt 15d01a5 
>   src/apps/marble-maps/TextToSpeechClient.h PRE-CREATION 
>   src/apps/marble-maps/TextToSpeechClient.cpp PRE-CREATION 
>   src/apps/marble-maps/main.cpp e1a74d6 
>   src/apps/marble-maps/package/AndroidManifest.xml dfb3061 
>   src/apps/marble-maps/package/src/org/kde/marble/maps/TextToSpeechClient.java PRE-CREATION 
> 
> Diff: https://git.reviewboard.kde.org/r/124703/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Gábor Péterffy
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20150813/6dbac740/attachment.html>


More information about the Marble-devel mailing list