Discussion:
Android Studio and Qt
(too old to reply)
Jason H
2016-02-24 22:41:51 UTC
Permalink
There is a step missing in http://www.kdab.com/qt-android-episode-6/
Where we go from importing the build.gradle to somehow having Java source to start debugging.

Can someone fill in the missing steps?
I didn't find any .java files.
m***@rpzdesign.com
2016-02-24 22:59:32 UTC
Permalink
Jason:

Its a little tricky, I think you have to open up the created project in
the build directory, not try to import from the source directory tree
where the qmake pro file is located.

Look at Build Settings -> Build Steps -> Make: main in /bla/bla/bla
directory and find the Debug -> android-build directory and magically
inside this directory is another gradle file.

Import from that build location and Android Studio will come up and be
able to process the java files while the compiled so C++ files are
loaded but not able to step into them as a native library.

That help?

md

On 2/24/2016 4:41 PM, Jason H wrote:
> There is a step missing in http://www.kdab.com/qt-android-episode-6/
> Where we go from importing the build.gradle to somehow having Java source to start debugging.
>
> Can someone fill in the missing steps?
> I didn't find any .java files.
> _______________________________________________
> Interest mailing list
> ***@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
Jason H
2016-02-25 00:41:01 UTC
Permalink
Hrm, that's not what the instructions said, but I can see your point. If correct though, I'd be usin the Qt-supplied/generated classes, but that means I'm editing code in the build dir? Shouldn't the code be under my project's android dir?

The article alludes to a projdir/android/src/com/company/... directory.


> Sent: Wednesday, February 24, 2016 at 5:59 PM
> From: "***@rpzdesign.com" <***@rpzdesign.com>
> To: ***@qt-project.org
> Subject: Re: [Interest] Android Studio and Qt
>
> Jason:
>
> Its a little tricky, I think you have to open up the created project in
> the build directory, not try to import from the source directory tree
> where the qmake pro file is located.
>
> Look at Build Settings -> Build Steps -> Make: main in /bla/bla/bla
> directory and find the Debug -> android-build directory and magically
> inside this directory is another gradle file.
>
> Import from that build location and Android Studio will come up and be
> able to process the java files while the compiled so C++ files are
> loaded but not able to step into them as a native library.
>
> That help?
>
> md
>
> On 2/24/2016 4:41 PM, Jason H wrote:
> > There is a step missing in http://www.kdab.com/qt-android-episode-6/
> > Where we go from importing the build.gradle to somehow having Java source to start debugging.
> >
> > Can someone fill in the missing steps?
> > I didn't find any .java files.
> > _______________________________________________
> > Interest mailing list
> > ***@qt-project.org
> > http://lists.qt-project.org/mailman/listinfo/interest
> >
>
> _______________________________________________
> Interest mailing list
> ***@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
m***@rpzdesign.com
2016-02-25 01:25:18 UTC
Permalink
Yes, edit the java code uptream and regenerate it back into the build
directory.



On 2/24/2016 6:41 PM, Jason H wrote:
> Hrm, that's not what the instructions said, but I can see your point. If correct though, I'd be usin the Qt-supplied/generated classes, but that means I'm editing code in the build dir? Shouldn't the code be under my project's android dir?
>
> The article alludes to a projdir/android/src/com/company/... directory.
>
>
>> Sent: Wednesday, February 24, 2016 at 5:59 PM
>> From: "***@rpzdesign.com" <***@rpzdesign.com>
>> To: ***@qt-project.org
>> Subject: Re: [Interest] Android Studio and Qt
>>
>> Jason:
>>
>> Its a little tricky, I think you have to open up the created project in
>> the build directory, not try to import from the source directory tree
>> where the qmake pro file is located.
>>
>> Look at Build Settings -> Build Steps -> Make: main in /bla/bla/bla
>> directory and find the Debug -> android-build directory and magically
>> inside this directory is another gradle file.
>>
>> Import from that build location and Android Studio will come up and be
>> able to process the java files while the compiled so C++ files are
>> loaded but not able to step into them as a native library.
>>
>> That help?
>>
>> md
>>
>> On 2/24/2016 4:41 PM, Jason H wrote:
>>> There is a step missing in http://www.kdab.com/qt-android-episode-6/
>>> Where we go from importing the build.gradle to somehow having Java source to start debugging.
>>>
>>> Can someone fill in the missing steps?
>>> I didn't find any .java files.
>>> _______________________________________________
>>> Interest mailing list
>>> ***@qt-project.org
>>> http://lists.qt-project.org/mailman/listinfo/interest
>>>
>> _______________________________________________
>> Interest mailing list
>> ***@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
Jason H
2016-02-25 02:38:00 UTC
Permalink
How does one "regenerate it back into the build directory"?

I would figure that there would be some ability to extend the supplied QtActivity and tell the build system to use that? But it seems like I need to set up some build steps to overwrite the supplied activity? That doesn't seem 'Qt' to me.

Many thanks for the insights so far!

> Sent: Wednesday, February 24, 2016 at 8:25 PM
> From: "***@rpzdesign.com" <***@rpzdesign.com>
> To: No recipient address
> Cc: "Jason H" <***@gmx.com>, "***@qt-project.org" <***@qt-project.org>
> Subject: Re: [Interest] Android Studio and Qt
>
> Yes, edit the java code uptream and regenerate it back into the build
> directory.
>
>
>
> On 2/24/2016 6:41 PM, Jason H wrote:
> > Hrm, that's not what the instructions said, but I can see your point. If correct though, I'd be usin the Qt-supplied/generated classes, but that means I'm editing code in the build dir? Shouldn't the code be under my project's android dir?
> >
> > The article alludes to a projdir/android/src/com/company/... directory.
> >
> >
> >> Sent: Wednesday, February 24, 2016 at 5:59 PM
> >> From: "***@rpzdesign.com" <***@rpzdesign.com>
> >> To: ***@qt-project.org
> >> Subject: Re: [Interest] Android Studio and Qt
> >>
> >> Jason:
> >>
> >> Its a little tricky, I think you have to open up the created project in
> >> the build directory, not try to import from the source directory tree
> >> where the qmake pro file is located.
> >>
> >> Look at Build Settings -> Build Steps -> Make: main in /bla/bla/bla
> >> directory and find the Debug -> android-build directory and magically
> >> inside this directory is another gradle file.
> >>
> >> Import from that build location and Android Studio will come up and be
> >> able to process the java files while the compiled so C++ files are
> >> loaded but not able to step into them as a native library.
> >>
> >> That help?
> >>
> >> md
> >>
> >> On 2/24/2016 4:41 PM, Jason H wrote:
> >>> There is a step missing in http://www.kdab.com/qt-android-episode-6/
> >>> Where we go from importing the build.gradle to somehow having Java source to start debugging.
> >>>
> >>> Can someone fill in the missing steps?
> >>> I didn't find any .java files.
> >>> _______________________________________________
> >>> Interest mailing list
> >>> ***@qt-project.org
> >>> http://lists.qt-project.org/mailman/listinfo/interest
> >>>
> >> _______________________________________________
> >> Interest mailing list
> >> ***@qt-project.org
> >> http://lists.qt-project.org/mailman/listinfo/interest
> >>
>
>
r***@gmail.com
2016-02-25 04:54:59 UTC
Permalink
Jason:

On 2/24/2016 8:38 PM, Jason H wrote:
> How does one "regenerate it back into the build directory"?

You want to look at the "use gradle builds" and then generate android
files in the project android setup in project preferences.

This will create an android subdirectory from your project main
directory. Put in their your MyActivity.java override java files and
then edit them.

When you "regenerate the project", these files are copied into the
android-build directory.

cheers.

md

> I would figure that there would be some ability to extend the supplied QtActivity and tell the build system to use that? But it seems like I need to set up some build steps to overwrite the supplied activity? That doesn't seem 'Qt' to me.
>
> Many thanks for the insights so far!
>
>> Sent: Wednesday, February 24, 2016 at 8:25 PM
>> From: "***@rpzdesign.com" <***@rpzdesign.com>
>> To: No recipient address
>> Cc: "Jason H" <***@gmx.com>, "***@qt-project.org" <***@qt-project.org>
>> Subject: Re: [Interest] Android Studio and Qt
>>
>> Yes, edit the java code uptream and regenerate it back into the build
>> directory.
>>
>>
>>
>> On 2/24/2016 6:41 PM, Jason H wrote:
>>> Hrm, that's not what the instructions said, but I can see your point. If correct though, I'd be usin the Qt-supplied/generated classes, but that means I'm editing code in the build dir? Shouldn't the code be under my project's android dir?
>>>
>>> The article alludes to a projdir/android/src/com/company/... directory.
>>>
>>>
>>>> Sent: Wednesday, February 24, 2016 at 5:59 PM
>>>> From: "***@rpzdesign.com" <***@rpzdesign.com>
>>>> To: ***@qt-project.org
>>>> Subject: Re: [Interest] Android Studio and Qt
>>>>
>>>> Jason:
>>>>
>>>> Its a little tricky, I think you have to open up the created project in
>>>> the build directory, not try to import from the source directory tree
>>>> where the qmake pro file is located.
>>>>
>>>> Look at Build Settings -> Build Steps -> Make: main in /bla/bla/bla
>>>> directory and find the Debug -> android-build directory and magically
>>>> inside this directory is another gradle file.
>>>>
>>>> Import from that build location and Android Studio will come up and be
>>>> able to process the java files while the compiled so C++ files are
>>>> loaded but not able to step into them as a native library.
>>>>
>>>> That help?
>>>>
>>>> md
>>>>
>>>> On 2/24/2016 4:41 PM, Jason H wrote:
>>>>> There is a step missing in http://www.kdab.com/qt-android-episode-6/
>>>>> Where we go from importing the build.gradle to somehow having Java source to start debugging.
>>>>>
>>>>> Can someone fill in the missing steps?
>>>>> I didn't find any .java files.
>>>>> _______________________________________________
>>>>> Interest mailing list
>>>>> ***@qt-project.org
>>>>> http://lists.qt-project.org/mailman/listinfo/interest
>>>>>
>>>> _______________________________________________
>>>> Interest mailing list
>>>> ***@qt-project.org
>>>> http://lists.qt-project.org/mailman/listinfo/interest
>>>>
>>
Jason H
2016-02-25 13:47:51 UTC
Permalink
> Jason:
>
> On 2/24/2016 8:38 PM, Jason H wrote:
> > How does one "regenerate it back into the build directory"?
>
> You want to look at the "use gradle builds" and then generate android
> files in the project android setup in project preferences.

Did that.

> This will create an android subdirectory from your project main
> directory. Put in their your MyActivity.java override java files and
> then edit them.

I already had an android directory, maybe this is an issue. Is there a skeleton override file provided for me to start with? Should I just copy the default QtActivity?

> When you "regenerate the project", these files are copied into the
> android-build directory.


Thanks for the help. I now have something to look into.
r***@gmail.com
2016-02-25 14:09:23 UTC
Permalink
You should look at the episodes 1-7 more carefully before tearing into
QtActivity.

md

On 2/25/2016 7:47 AM, Jason H wrote:
>> Jason:
>>
>> On 2/24/2016 8:38 PM, Jason H wrote:
>>> How does one "regenerate it back into the build directory"?
>> You want to look at the "use gradle builds" and then generate android
>> files in the project android setup in project preferences.
> Did that.
>
>> This will create an android subdirectory from your project main
>> directory. Put in their your MyActivity.java override java files and
>> then edit them.
> I already had an android directory, maybe this is an issue. Is there a skeleton override file provided for me to start with? Should I just copy the default QtActivity?
>
>> When you "regenerate the project", these files are copied into the
>> android-build directory.
>
> Thanks for the help. I now have something to look into.
>
Jason H
2016-02-26 15:22:12 UTC
Permalink
Well the only way is to just hack at it. The stuff I wanted was on page 7, but it doesn't allude to that on page 6.

Anyway, I'm not sure why we have to use gradle as my Android stuff works and I still seem to be using Ant?


> Sent: Thursday, February 25, 2016 at 9:09 AM
> From: "***@gmail.com" <***@gmail.com>
> To: "***@qt-project.org" <***@qt-project.org>
> Cc: "Jason H" <***@gmx.com>
> Subject: Re: [Interest] Android Studio and Qt
>
> You should look at the episodes 1-7 more carefully before tearing into
> QtActivity.
>
> md
>
> On 2/25/2016 7:47 AM, Jason H wrote:
> >> Jason:
> >>
> >> On 2/24/2016 8:38 PM, Jason H wrote:
> >>> How does one "regenerate it back into the build directory"?
> >> You want to look at the "use gradle builds" and then generate android
> >> files in the project android setup in project preferences.
> > Did that.
> >
> >> This will create an android subdirectory from your project main
> >> directory. Put in their your MyActivity.java override java files and
> >> then edit them.
> > I already had an android directory, maybe this is an issue. Is there a skeleton override file provided for me to start with? Should I just copy the default QtActivity?
> >
> >> When you "regenerate the project", these files are copied into the
> >> android-build directory.
> >
> > Thanks for the help. I now have something to look into.
> >
>
>
Continue reading on narkive:
Loading...