Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

C++ For Android?

OP jrdemasi

27th August 2013, 05:26 AM   |  #1  
OP Junior Member
Thanks Meter: 0
 
13 posts
Join Date:Joined: Jan 2011
Hey all,

I'm pretty new to android development and I was curious if anyone could tell me the benefits of learning C++ alongside Java (specifically while working with Android).

My first project that I'd like to accomplish seems a little arduous, though I do have help. I'm attempting to create an app that is used to catalog clothes, but also parses image data to detect the colors. In this way, it will be (hopefully, by some means) possible to have the app help match the clothes for the user. The inspiration for this is my extreme colorblindness.

Anyone who potentially has feedback regarding interpreting data from the camera on Android, feel free to pitch your two cents.
27th August 2013, 05:46 AM   |  #2  
ScatteredHell's Avatar
Senior Member
Flag Colombo
Thanks Meter: 532
 
1,884 posts
Join Date:Joined: Jul 2012
More
Read this. May help you. http://forum.xda-developers.com/show....php?t=2225668

Sent from my SonyX8 using Tapatalk 2
28th August 2013, 08:10 PM   |  #3  
OP Junior Member
Thanks Meter: 0
 
13 posts
Join Date:Joined: Jan 2011
Quote:
Originally Posted by ScatteredHell

Read this. May help you. http://forum.xda-developers.com/show....php?t=2225668

Sent from my SonyX8 using Tapatalk 2

Thanks so much!

Sent from my HTC One using xda app-developers app
3rd September 2013, 10:37 PM   |  #4  
Junior Member
Thanks Meter: 0
 
6 posts
Join Date:Joined: Sep 2013
not sure you need c++ for your project
My experience with C++ (using Marmalade) is that if you need a lot of UI, than you are better off with the Java framework. Designing UI with Marmalade is a real pain. It's great for power hungry games and apps, but not for UI.

If you absolutely need to use C++, my advise it to start with the native Java and NDK, and only if you're not satisfied, look elsewhere. Even in Marmalade, which is supposed to be cross-platform, you will reach the point, too quickly in my opinion, in which the SDK doesn't give a cross platform solution to what you want (say use a downloaded third-party sdk, or request some OS function that the SDK does not offer), and you will have to implement specific OS "EDKs", so will have to know your native coding anyway.
25th September 2013, 12:11 PM   |  #5  
Member
Thanks Meter: 9
 
35 posts
Join Date:Joined: Apr 2011
Hi,
you should try Qt, though you need the android sdk/ndk, Jdk and Ant as well, but it works.
Last edited by blablabla123456789; 25th September 2013 at 12:17 PM.
26th September 2013, 05:07 PM   |  #6  
vishjoshi's Avatar
Junior Member
Flag Junagadh
Thanks Meter: 2
 
13 posts
Join Date:Joined: Sep 2013
Quote:
Originally Posted by jrdemasi

Hey all,

I'm pretty new to android development and I was curious if anyone could tell me the benefits of learning C++ alongside Java (specifically while working with Android).

My first project that I'd like to accomplish seems a little arduous, though I do have help. I'm attempting to create an app that is used to catalog clothes, but also parses image data to detect the colors. In this way, it will be (hopefully, by some means) possible to have the app help match the clothes for the user. The inspiration for this is my extreme colorblindness.

Anyone who potentially has feedback regarding interpreting data from the camera on Android, feel free to pitch your two cents.

Get a book from fipkart to lear this. "Android Devlopment"
6th December 2013, 09:40 AM   |  #7  
Junior Member
Thanks Meter: 0
 
17 posts
Join Date:Joined: Oct 2013
Quote:
Originally Posted by jrdemasi

Hey all,

I'm pretty new to android development and I was curious if anyone could tell me the benefits of learning C++ alongside Java (specifically while working with Android).

My first project that I'd like to accomplish seems a little arduous, though I do have help. I'm attempting to create an app that is used to catalog clothes, but also parses image data to detect the colors. In this way, it will be (hopefully, by some means) possible to have the app help match the clothes for the user. The inspiration for this is my extreme colorblindness.

Anyone who potentially has feedback regarding interpreting data from the camera on Android, feel free to pitch your two cents.

I would choose for this between two options: develop entirely in Java except for the portions that are computationally heavy, which can be implemented in C/C++ using JNI glue code. Or you may implement everything using a C++ based framework, like Qt, both for the creation of the UI and of the rest of your application. With Qt of course, the specific UI portion can be written using QML, which might be faster.
30th December 2013, 01:51 PM   |  #8  
Member
Thanks Meter: 19
 
34 posts
Join Date:Joined: Jun 2013
Quote:
Originally Posted by const_char

I would choose for this between two options: develop entirely in Java except for the portions that are computationally heavy, which can be implemented in C/C++ using JNI glue code.

I second this, with the sidenote that you should only use C/C++ if the computationally heavy code is actually time-critical.
I mean, at first glance, your project sounds like it won't be very taxing on the CPU anyway. So having a full Java version may still be fast enough, and the user wouldn't even know the difference. In that case C/C++ is not worth the trouble (JNI is very ugly, and you shouldn't use it unless you really have to).
22nd February 2014, 05:20 AM   |  #9  
Junior Member
Thanks Meter: 0
 
8 posts
Join Date:Joined: Feb 2014
Smile C++
I think C++ is not for suitable for this application. Although i did not use it. But you may first take some tutorial then you can start. When face problem then discus this forum. I am sure somebody may help you.

Sorry for my English.

Thank you
26th February 2014, 09:04 AM   |  #10  
Junior Member
Thanks Meter: 1
 
3 posts
Join Date:Joined: Feb 2014
Wink you can get pixel color use this sample code.
Quote:
Originally Posted by jrdemasi

Hey all,

I'm pretty new to android development and I was curious if anyone could tell me the benefits of learning C++ alongside Java (specifically while working with Android).

My first project that I'd like to accomplish seems a little arduous, though I do have help. I'm attempting to create an app that is used to catalog clothes, but also parses image data to detect the colors. In this way, it will be (hopefully, by some means) possible to have the app help match the clothes for the user. The inspiration for this is my extreme colorblindness.

Anyone who potentially has feedback regarding interpreting data from the camera on Android, feel free to pitch your two cents.

you can get pixel color use this sample code.

String imageUrl = SOME_IMG_URL;
InputStream in = new java.net.URL(imageUrl).openStream();
Bitmap bitmap = BitmapFactory.decodeStream(in);
int pixel = bitmap.getPixel(x,y);

and.

int red = Color.red(pixel);
int blue = Color.blue(pixel);
int green = Color.green(pixel);

you can get average color value of SOME_IMG and you can catalog this.
it seems easy!

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes