Csound Csound-dev Csound-tekno Search About

[Cs-dev] C++ API for Android

Date2015-09-09 11:54
FromPeter Burgess
Subject[Cs-dev] C++ API for Android
AttachmentsNone  None  

Is there a way of working with Csound and C++ for android? Or can you only use Java for this?


Date2015-09-09 12:10
FromSteven Yi
SubjectRe: [Cs-dev] C++ API for Android
Yes, it is possible to use Csound on Android with C++. Tarmo posted
about it a while back here:

http://csound.1045644.n5.nabble.com/Csound-apps-for-Android-in-Qt-C-td5733453.html

On Wed, Sep 9, 2015 at 11:54 AM, Peter Burgess
 wrote:
> Is there a way of working with Csound and C++ for android? Or can you only
> use Java for this?
>
>
> ------------------------------------------------------------------------------
> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
> Get real-time metrics from all of your servers, apps and tools
> in one place.
> SourceForge users - Click here to start your Free Trial of Datadog now!
> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2015-09-09 12:16
FromMichael Gogins
SubjectRe: [Cs-dev] C++ API for Android
AttachmentsNone  None  

Csound is written in C with some opcodes and the audio interface layer written in C++. This is true on Android as well. But on Android the operating system user interface and user services are actually written in Java so that is the language everyone uses to write apps. You can also use HTML and Javascript because on Android Javascript easily talks to Java.

So if you want to do something with Csound in C or C++ on Android, that's good if it doesn't involve the user interface. If it does, you pretty much have to use Java or else HTML and Javascript.

Regards,
Mike

On Sep 9, 2015 6:54 AM, "Peter Burgess" <pete.soundtechnician@gmail.com> wrote:

Is there a way of working with Csound and C++ for android? Or can you only use Java for this?


------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2015-09-09 12:30
FromSteven Yi
SubjectRe: [Cs-dev] C++ API for Android
I'm not sure that's quite right. It was true early on with Android,
but developers can write applications on Android with C/C++ without
any Java code and still create UIs.  (I think this was primarily to
cater to the game developer crowd.)

http://developer.android.com/ndk/guides/concepts.html#naa
http://developer.android.com/reference/android/app/NativeActivity.html

On Wed, Sep 9, 2015 at 12:16 PM, Michael Gogins
 wrote:
> Csound is written in C with some opcodes and the audio interface layer
> written in C++. This is true on Android as well. But on Android the
> operating system user interface and user services are actually written in
> Java so that is the language everyone uses to write apps. You can also use
> HTML and Javascript because on Android Javascript easily talks to Java.
>
> So if you want to do something with Csound in C or C++ on Android, that's
> good if it doesn't involve the user interface. If it does, you pretty much
> have to use Java or else HTML and Javascript.
>
> Regards,
> Mike
>
> On Sep 9, 2015 6:54 AM, "Peter Burgess" 
> wrote:
>>
>> Is there a way of working with Csound and C++ for android? Or can you only
>> use Java for this?
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>> Get real-time metrics from all of your servers, apps and tools
>> in one place.
>> SourceForge users - Click here to start your Free Trial of Datadog now!
>> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>
> ------------------------------------------------------------------------------
> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
> Get real-time metrics from all of your servers, apps and tools
> in one place.
> SourceForge users - Click here to start your Free Trial of Datadog now!
> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2015-09-09 13:03
FromMichael Gogins
SubjectRe: [Cs-dev] C++ API for Android
I understand that you can do it using Java Native Interface calls from
C++ to the Java OS calls. I didn't mention this because it's not worth
the trouble for anything complex. But are you saying there are now
C/C++ OS calls along with the Java ones?

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Wed, Sep 9, 2015 at 7:30 AM, Steven Yi  wrote:
> I'm not sure that's quite right. It was true early on with Android,
> but developers can write applications on Android with C/C++ without
> any Java code and still create UIs.  (I think this was primarily to
> cater to the game developer crowd.)
>
> http://developer.android.com/ndk/guides/concepts.html#naa
> http://developer.android.com/reference/android/app/NativeActivity.html
>
> On Wed, Sep 9, 2015 at 12:16 PM, Michael Gogins
>  wrote:
>> Csound is written in C with some opcodes and the audio interface layer
>> written in C++. This is true on Android as well. But on Android the
>> operating system user interface and user services are actually written in
>> Java so that is the language everyone uses to write apps. You can also use
>> HTML and Javascript because on Android Javascript easily talks to Java.
>>
>> So if you want to do something with Csound in C or C++ on Android, that's
>> good if it doesn't involve the user interface. If it does, you pretty much
>> have to use Java or else HTML and Javascript.
>>
>> Regards,
>> Mike
>>
>> On Sep 9, 2015 6:54 AM, "Peter Burgess" 
>> wrote:
>>>
>>> Is there a way of working with Csound and C++ for android? Or can you only
>>> use Java for this?
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>>> Get real-time metrics from all of your servers, apps and tools
>>> in one place.
>>> SourceForge users - Click here to start your Free Trial of Datadog now!
>>> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>
>> ------------------------------------------------------------------------------
>> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>> Get real-time metrics from all of your servers, apps and tools
>> in one place.
>> SourceForge users - Click here to start your Free Trial of Datadog now!
>> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>
> ------------------------------------------------------------------------------
> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
> Get real-time metrics from all of your servers, apps and tools
> in one place.
> SourceForge users - Click here to start your Free Trial of Datadog now!
> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2015-09-09 13:13
FromSteven Yi
SubjectRe: [Cs-dev] C++ API for Android
You can read at the link:

"Convenience for implementing an activity that will be implemented
purely in native code. That is, a game (or game-like thing). There is
no need to derive from this class; you can simply declare it in your
manifest, and use the NDK APIs from there."

The documentation talk about things like direct access to sensors as
well that may be more efficient than going through the Java layer.

With a native activity, you'd be working with low-level API's like
OpenGL and OpenSL. The libraries you can link to and headers are all
provided with the NDK.  You can view available libraries by Android
version here:

http://developer.android.com/ndk/guides/stable_apis.html

On Wed, Sep 9, 2015 at 1:03 PM, Michael Gogins  wrote:
> I understand that you can do it using Java Native Interface calls from
> C++ to the Java OS calls. I didn't mention this because it's not worth
> the trouble for anything complex. But are you saying there are now
> C/C++ OS calls along with the Java ones?
>
> Best,
> Mike
>
> -----------------------------------------------------
> Michael Gogins
> Irreducible Productions
> http://michaelgogins.tumblr.com
> Michael dot Gogins at gmail dot com
>
>
> On Wed, Sep 9, 2015 at 7:30 AM, Steven Yi  wrote:
>> I'm not sure that's quite right. It was true early on with Android,
>> but developers can write applications on Android with C/C++ without
>> any Java code and still create UIs.  (I think this was primarily to
>> cater to the game developer crowd.)
>>
>> http://developer.android.com/ndk/guides/concepts.html#naa
>> http://developer.android.com/reference/android/app/NativeActivity.html
>>
>> On Wed, Sep 9, 2015 at 12:16 PM, Michael Gogins
>>  wrote:
>>> Csound is written in C with some opcodes and the audio interface layer
>>> written in C++. This is true on Android as well. But on Android the
>>> operating system user interface and user services are actually written in
>>> Java so that is the language everyone uses to write apps. You can also use
>>> HTML and Javascript because on Android Javascript easily talks to Java.
>>>
>>> So if you want to do something with Csound in C or C++ on Android, that's
>>> good if it doesn't involve the user interface. If it does, you pretty much
>>> have to use Java or else HTML and Javascript.
>>>
>>> Regards,
>>> Mike
>>>
>>> On Sep 9, 2015 6:54 AM, "Peter Burgess" 
>>> wrote:
>>>>
>>>> Is there a way of working with Csound and C++ for android? Or can you only
>>>> use Java for this?
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>>>> Get real-time metrics from all of your servers, apps and tools
>>>> in one place.
>>>> SourceForge users - Click here to start your Free Trial of Datadog now!
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>>> Get real-time metrics from all of your servers, apps and tools
>>> in one place.
>>> SourceForge users - Click here to start your Free Trial of Datadog now!
>>> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>
>> ------------------------------------------------------------------------------
>> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>> Get real-time metrics from all of your servers, apps and tools
>> in one place.
>> SourceForge users - Click here to start your Free Trial of Datadog now!
>> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
> Get real-time metrics from all of your servers, apps and tools
> in one place.
> SourceForge users - Click here to start your Free Trial of Datadog now!
> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2015-09-09 14:24
FromMichael Gogins
SubjectRe: [Cs-dev] C++ API for Android
Yes, I have looked at this before. As I recall, there are no
facilities for constructing user interface widgets, menus, text boxes,
etc. but I will check the documentation and report back.

If it were possible to construct a native Android UI directly from C++
without jumping through hoops, this would be far better in my opinion,
and I would port Csound for Android to it.

However, I have now read through the docs, and it still looks as
though, if you want a native Android user interface with standard
widgets, you still have to make Java OS calls one way or the other. In
my view, this still means it makes sense to write Csound for Android
in two layers as we do know, a C shared library and a Java app.

Native activities seems to be designed for games, and enable you to
access key strokes, voice input, other sensors, and so on from C/C++.
In theory one could re-implement all the required user interface
widgets in OpenGL, but I haven't heard of anyone doing that for
Android, and projects that did that for desktop platforms never became
widely used (more's the pity, it made sense to me). (But I will look
around...)

Of course, if you don't need the standard Android widgets and you want
to write a native app using the Csound API and OpenGL, it could
simplify your life to do it all in C++.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Wed, Sep 9, 2015 at 8:13 AM, Steven Yi  wrote:
> You can read at the link:
>
> "Convenience for implementing an activity that will be implemented
> purely in native code. That is, a game (or game-like thing). There is
> no need to derive from this class; you can simply declare it in your
> manifest, and use the NDK APIs from there."
>
> The documentation talk about things like direct access to sensors as
> well that may be more efficient than going through the Java layer.
>
> With a native activity, you'd be working with low-level API's like
> OpenGL and OpenSL. The libraries you can link to and headers are all
> provided with the NDK.  You can view available libraries by Android
> version here:
>
> http://developer.android.com/ndk/guides/stable_apis.html
>
> On Wed, Sep 9, 2015 at 1:03 PM, Michael Gogins  wrote:
>> I understand that you can do it using Java Native Interface calls from
>> C++ to the Java OS calls. I didn't mention this because it's not worth
>> the trouble for anything complex. But are you saying there are now
>> C/C++ OS calls along with the Java ones?
>>
>> Best,
>> Mike
>>
>> -----------------------------------------------------
>> Michael Gogins
>> Irreducible Productions
>> http://michaelgogins.tumblr.com
>> Michael dot Gogins at gmail dot com
>>
>>
>> On Wed, Sep 9, 2015 at 7:30 AM, Steven Yi  wrote:
>>> I'm not sure that's quite right. It was true early on with Android,
>>> but developers can write applications on Android with C/C++ without
>>> any Java code and still create UIs.  (I think this was primarily to
>>> cater to the game developer crowd.)
>>>
>>> http://developer.android.com/ndk/guides/concepts.html#naa
>>> http://developer.android.com/reference/android/app/NativeActivity.html
>>>
>>> On Wed, Sep 9, 2015 at 12:16 PM, Michael Gogins
>>>  wrote:
>>>> Csound is written in C with some opcodes and the audio interface layer
>>>> written in C++. This is true on Android as well. But on Android the
>>>> operating system user interface and user services are actually written in
>>>> Java so that is the language everyone uses to write apps. You can also use
>>>> HTML and Javascript because on Android Javascript easily talks to Java.
>>>>
>>>> So if you want to do something with Csound in C or C++ on Android, that's
>>>> good if it doesn't involve the user interface. If it does, you pretty much
>>>> have to use Java or else HTML and Javascript.
>>>>
>>>> Regards,
>>>> Mike
>>>>
>>>> On Sep 9, 2015 6:54 AM, "Peter Burgess" 
>>>> wrote:
>>>>>
>>>>> Is there a way of working with Csound and C++ for android? Or can you only
>>>>> use Java for this?
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>>>>> Get real-time metrics from all of your servers, apps and tools
>>>>> in one place.
>>>>> SourceForge users - Click here to start your Free Trial of Datadog now!
>>>>> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>>>> Get real-time metrics from all of your servers, apps and tools
>>>> in one place.
>>>> SourceForge users - Click here to start your Free Trial of Datadog now!
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>>> Get real-time metrics from all of your servers, apps and tools
>>> in one place.
>>> SourceForge users - Click here to start your Free Trial of Datadog now!
>>> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ------------------------------------------------------------------------------
>> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>> Get real-time metrics from all of your servers, apps and tools
>> in one place.
>> SourceForge users - Click here to start your Free Trial of Datadog now!
>> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
> Get real-time metrics from all of your servers, apps and tools
> in one place.
> SourceForge users - Click here to start your Free Trial of Datadog now!
> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2015-09-09 17:31
FromPeter Burgess
SubjectRe: [Cs-dev] C++ API for Android
AttachmentsNone  None  
I have to admit, I don't know exactly what you mean by standard Android widgets, but my UI isn't going to be overly complex. There will be no user-controls that aren't passed directly to the c++ program. It's also maybe beneficial that I haven't created the UI yet. I was going to learn Qt to do it (on my linux machine first). Do you think I'd struggle to port this to android?

I guess it might be worth me making a very simple csound-c++ app to test the android port before trying to port my whole program.

Cheers both of you for your responses! I'll have a read through your links when I get a sec later too.

Pete

On Wed, Sep 9, 2015 at 2:24 PM, Michael Gogins <michael.gogins@gmail.com> wrote:
Yes, I have looked at this before. As I recall, there are no
facilities for constructing user interface widgets, menus, text boxes,
etc. but I will check the documentation and report back.

If it were possible to construct a native Android UI directly from C++
without jumping through hoops, this would be far better in my opinion,
and I would port Csound for Android to it.

However, I have now read through the docs, and it still looks as
though, if you want a native Android user interface with standard
widgets, you still have to make Java OS calls one way or the other. In
my view, this still means it makes sense to write Csound for Android
in two layers as we do know, a C shared library and a Java app.

Native activities seems to be designed for games, and enable you to
access key strokes, voice input, other sensors, and so on from C/C++.
In theory one could re-implement all the required user interface
widgets in OpenGL, but I haven't heard of anyone doing that for
Android, and projects that did that for desktop platforms never became
widely used (more's the pity, it made sense to me). (But I will look
around...)

Of course, if you don't need the standard Android widgets and you want
to write a native app using the Csound API and OpenGL, it could
simplify your life to do it all in C++.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Wed, Sep 9, 2015 at 8:13 AM, Steven Yi <stevenyi@gmail.com> wrote:
> You can read at the link:
>
> "Convenience for implementing an activity that will be implemented
> purely in native code. That is, a game (or game-like thing). There is
> no need to derive from this class; you can simply declare it in your
> manifest, and use the NDK APIs from there."
>
> The documentation talk about things like direct access to sensors as
> well that may be more efficient than going through the Java layer.
>
> With a native activity, you'd be working with low-level API's like
> OpenGL and OpenSL. The libraries you can link to and headers are all
> provided with the NDK.  You can view available libraries by Android
> version here:
>
> http://developer.android.com/ndk/guides/stable_apis.html
>
> On Wed, Sep 9, 2015 at 1:03 PM, Michael Gogins <michael.gogins@gmail.com> wrote:
>> I understand that you can do it using Java Native Interface calls from
>> C++ to the Java OS calls. I didn't mention this because it's not worth
>> the trouble for anything complex. But are you saying there are now
>> C/C++ OS calls along with the Java ones?
>>
>> Best,
>> Mike
>>
>> -----------------------------------------------------
>> Michael Gogins
>> Irreducible Productions
>> http://michaelgogins.tumblr.com
>> Michael dot Gogins at gmail dot com
>>
>>
>> On Wed, Sep 9, 2015 at 7:30 AM, Steven Yi <stevenyi@gmail.com> wrote:
>>> I'm not sure that's quite right. It was true early on with Android,
>>> but developers can write applications on Android with C/C++ without
>>> any Java code and still create UIs.  (I think this was primarily to
>>> cater to the game developer crowd.)
>>>
>>> http://developer.android.com/ndk/guides/concepts.html#naa
>>> http://developer.android.com/reference/android/app/NativeActivity.html
>>>
>>> On Wed, Sep 9, 2015 at 12:16 PM, Michael Gogins
>>> <michael.gogins@gmail.com> wrote:
>>>> Csound is written in C with some opcodes and the audio interface layer
>>>> written in C++. This is true on Android as well. But on Android the
>>>> operating system user interface and user services are actually written in
>>>> Java so that is the language everyone uses to write apps. You can also use
>>>> HTML and Javascript because on Android Javascript easily talks to Java.
>>>>
>>>> So if you want to do something with Csound in C or C++ on Android, that's
>>>> good if it doesn't involve the user interface. If it does, you pretty much
>>>> have to use Java or else HTML and Javascript.
>>>>
>>>> Regards,
>>>> Mike
>>>>
>>>> On Sep 9, 2015 6:54 AM, "Peter Burgess" <pete.soundtechnician@gmail.com>
>>>> wrote:
>>>>>
>>>>> Is there a way of working with Csound and C++ for android? Or can you only
>>>>> use Java for this?
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>>>>> Get real-time metrics from all of your servers, apps and tools
>>>>> in one place.
>>>>> SourceForge users - Click here to start your Free Trial of Datadog now!
>>>>> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>>>> Get real-time metrics from all of your servers, apps and tools
>>>> in one place.
>>>> SourceForge users - Click here to start your Free Trial of Datadog now!
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>>> Get real-time metrics from all of your servers, apps and tools
>>> in one place.
>>> SourceForge users - Click here to start your Free Trial of Datadog now!
>>> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>> ------------------------------------------------------------------------------
>> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>> Get real-time metrics from all of your servers, apps and tools
>> in one place.
>> SourceForge users - Click here to start your Free Trial of Datadog now!
>> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
> ------------------------------------------------------------------------------
> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
> Get real-time metrics from all of your servers, apps and tools
> in one place.
> SourceForge users - Click here to start your Free Trial of Datadog now!
> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2015-09-09 17:37
FromMichael Gogins
SubjectRe: [Cs-dev] C++ API for Android
Consult the Android SDK to learn the standard Android widgets here:
https://developer.android.com/guide/topics/ui/index.html

What do you mean, "there will be no user-controls that aren't passed
directly to the C++ program?"

It would be helpful if I understood the basic purpose of your proposed
application.

Regards,
Mike


-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Wed, Sep 9, 2015 at 12:31 PM, Peter Burgess
 wrote:
> I have to admit, I don't know exactly what you mean by standard Android
> widgets, but my UI isn't going to be overly complex. There will be no
> user-controls that aren't passed directly to the c++ program. It's also
> maybe beneficial that I haven't created the UI yet. I was going to learn Qt
> to do it (on my linux machine first). Do you think I'd struggle to port this
> to android?
>
> I guess it might be worth me making a very simple csound-c++ app to test the
> android port before trying to port my whole program.
>
> Cheers both of you for your responses! I'll have a read through your links
> when I get a sec later too.
>
> Pete
>
> On Wed, Sep 9, 2015 at 2:24 PM, Michael Gogins 
> wrote:
>>
>> Yes, I have looked at this before. As I recall, there are no
>> facilities for constructing user interface widgets, menus, text boxes,
>> etc. but I will check the documentation and report back.
>>
>> If it were possible to construct a native Android UI directly from C++
>> without jumping through hoops, this would be far better in my opinion,
>> and I would port Csound for Android to it.
>>
>> However, I have now read through the docs, and it still looks as
>> though, if you want a native Android user interface with standard
>> widgets, you still have to make Java OS calls one way or the other. In
>> my view, this still means it makes sense to write Csound for Android
>> in two layers as we do know, a C shared library and a Java app.
>>
>> Native activities seems to be designed for games, and enable you to
>> access key strokes, voice input, other sensors, and so on from C/C++.
>> In theory one could re-implement all the required user interface
>> widgets in OpenGL, but I haven't heard of anyone doing that for
>> Android, and projects that did that for desktop platforms never became
>> widely used (more's the pity, it made sense to me). (But I will look
>> around...)
>>
>> Of course, if you don't need the standard Android widgets and you want
>> to write a native app using the Csound API and OpenGL, it could
>> simplify your life to do it all in C++.
>>
>> Best,
>> Mike
>>
>> -----------------------------------------------------
>> Michael Gogins
>> Irreducible Productions
>> http://michaelgogins.tumblr.com
>> Michael dot Gogins at gmail dot com
>>
>>
>> On Wed, Sep 9, 2015 at 8:13 AM, Steven Yi  wrote:
>> > You can read at the link:
>> >
>> > "Convenience for implementing an activity that will be implemented
>> > purely in native code. That is, a game (or game-like thing). There is
>> > no need to derive from this class; you can simply declare it in your
>> > manifest, and use the NDK APIs from there."
>> >
>> > The documentation talk about things like direct access to sensors as
>> > well that may be more efficient than going through the Java layer.
>> >
>> > With a native activity, you'd be working with low-level API's like
>> > OpenGL and OpenSL. The libraries you can link to and headers are all
>> > provided with the NDK.  You can view available libraries by Android
>> > version here:
>> >
>> > http://developer.android.com/ndk/guides/stable_apis.html
>> >
>> > On Wed, Sep 9, 2015 at 1:03 PM, Michael Gogins
>> >  wrote:
>> >> I understand that you can do it using Java Native Interface calls from
>> >> C++ to the Java OS calls. I didn't mention this because it's not worth
>> >> the trouble for anything complex. But are you saying there are now
>> >> C/C++ OS calls along with the Java ones?
>> >>
>> >> Best,
>> >> Mike
>> >>
>> >> -----------------------------------------------------
>> >> Michael Gogins
>> >> Irreducible Productions
>> >> http://michaelgogins.tumblr.com
>> >> Michael dot Gogins at gmail dot com
>> >>
>> >>
>> >> On Wed, Sep 9, 2015 at 7:30 AM, Steven Yi  wrote:
>> >>> I'm not sure that's quite right. It was true early on with Android,
>> >>> but developers can write applications on Android with C/C++ without
>> >>> any Java code and still create UIs.  (I think this was primarily to
>> >>> cater to the game developer crowd.)
>> >>>
>> >>> http://developer.android.com/ndk/guides/concepts.html#naa
>> >>> http://developer.android.com/reference/android/app/NativeActivity.html
>> >>>
>> >>> On Wed, Sep 9, 2015 at 12:16 PM, Michael Gogins
>> >>>  wrote:
>> >>>> Csound is written in C with some opcodes and the audio interface
>> >>>> layer
>> >>>> written in C++. This is true on Android as well. But on Android the
>> >>>> operating system user interface and user services are actually
>> >>>> written in
>> >>>> Java so that is the language everyone uses to write apps. You can
>> >>>> also use
>> >>>> HTML and Javascript because on Android Javascript easily talks to
>> >>>> Java.
>> >>>>
>> >>>> So if you want to do something with Csound in C or C++ on Android,
>> >>>> that's
>> >>>> good if it doesn't involve the user interface. If it does, you pretty
>> >>>> much
>> >>>> have to use Java or else HTML and Javascript.
>> >>>>
>> >>>> Regards,
>> >>>> Mike
>> >>>>
>> >>>> On Sep 9, 2015 6:54 AM, "Peter Burgess"
>> >>>> 
>> >>>> wrote:
>> >>>>>
>> >>>>> Is there a way of working with Csound and C++ for android? Or can
>> >>>>> you only
>> >>>>> use Java for this?
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> ------------------------------------------------------------------------------
>> >>>>> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>> >>>>> Get real-time metrics from all of your servers, apps and tools
>> >>>>> in one place.
>> >>>>> SourceForge users - Click here to start your Free Trial of Datadog
>> >>>>> now!
>> >>>>> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>> >>>>> _______________________________________________
>> >>>>> Csound-devel mailing list
>> >>>>> Csound-devel@lists.sourceforge.net
>> >>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> >>>>>
>> >>>>
>> >>>>
>> >>>> ------------------------------------------------------------------------------
>> >>>> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>> >>>> Get real-time metrics from all of your servers, apps and tools
>> >>>> in one place.
>> >>>> SourceForge users - Click here to start your Free Trial of Datadog
>> >>>> now!
>> >>>> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>> >>>> _______________________________________________
>> >>>> Csound-devel mailing list
>> >>>> Csound-devel@lists.sourceforge.net
>> >>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> >>>>
>> >>>
>> >>>
>> >>> ------------------------------------------------------------------------------
>> >>> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>> >>> Get real-time metrics from all of your servers, apps and tools
>> >>> in one place.
>> >>> SourceForge users - Click here to start your Free Trial of Datadog
>> >>> now!
>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>> >>> _______________________________________________
>> >>> Csound-devel mailing list
>> >>> Csound-devel@lists.sourceforge.net
>> >>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> >>
>> >>
>> >> ------------------------------------------------------------------------------
>> >> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>> >> Get real-time metrics from all of your servers, apps and tools
>> >> in one place.
>> >> SourceForge users - Click here to start your Free Trial of Datadog now!
>> >> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>> >> _______________________________________________
>> >> Csound-devel mailing list
>> >> Csound-devel@lists.sourceforge.net
>> >> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> >
>> >
>> > ------------------------------------------------------------------------------
>> > Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>> > Get real-time metrics from all of your servers, apps and tools
>> > in one place.
>> > SourceForge users - Click here to start your Free Trial of Datadog now!
>> > http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>> > _______________________________________________
>> > Csound-devel mailing list
>> > Csound-devel@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>> ------------------------------------------------------------------------------
>> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
>> Get real-time metrics from all of your servers, apps and tools
>> in one place.
>> SourceForge users - Click here to start your Free Trial of Datadog now!
>> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>
> ------------------------------------------------------------------------------
> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
> Get real-time metrics from all of your servers, apps and tools
> in one place.
> SourceForge users - Click here to start your Free Trial of Datadog now!
> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2015-09-09 20:12
FromPeter Burgess
SubjectRe: [Cs-dev] C++ API for Android
AttachmentsNone  None  

Its gonna be a tool for algorithmic composition, so the user controls will all communicate directly with the c++ layer, and C++ will do all the talking with Csound.

Cheers for the link! In truth I don't even entirely know what widgets are, never made a proper UI before, but I'm about to start the soon so widgets is high on my list of things to read up on.


Date2015-09-09 20:58
FromPeter Burgess
SubjectRe: [Cs-dev] C++ API for Android
AttachmentsNone  None  

@steven that link in the first message is awesome. That's got pretty much all the info I need, thanks!