Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,771,463 Members 50,650 Now Online
XDA Developers Android and Mobile Development Forum

C++ For Android?

Tip us?
 
jrdemasi
Old
#1  
Junior Member - OP
Thanks Meter 0
Posts: 13
Join Date: Jan 2011
Default C++ For Android?

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.
 
ScatteredHell
Old
#2  
ScatteredHell's Avatar
Senior Member
Thanks Meter 530
Posts: 1,872
Join Date: Jul 2012
Location: Colombo
Read this. May help you. http://forum.xda-developers.com/show....php?t=2225668

Sent from my SonyX8 using Tapatalk 2
"An EXPERT is someone who has made all the mistakes which can be made, in a very narrow field" - Niels Bohr

--------------------------------------------------------------------------
----------------------------------------------------------------------------------------------Thanks to UKICAR@XDA

 
Are you a COD MW3 Player? Tired With play with Hackers on TG & 4D1?
Join with us, No Cheaters can Compete Project Tiger Killer
 
jrdemasi
Old
#3  
Junior Member - OP
Thanks Meter 0
Posts: 13
Join Date: Jan 2011
Quote:
Originally Posted by ScatteredHell View Post
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
 
PiccoTripex
Old
#4  
Junior Member
Thanks Meter 0
Posts: 6
Join Date: Sep 2013
Default 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.
 
blablabla123456789
Old
(Last edited by blablabla123456789; 25th September 2013 at 11:17 AM.)
#5  
Member
Thanks Meter 9
Posts: 35
Join Date: Apr 2011
Hi,
you should try Qt, though you need the android sdk/ndk, Jdk and Ant as well, but it works.
 
vishjoshi
Old
#6  
vishjoshi's Avatar
Junior Member
Thanks Meter 1
Posts: 13
Join Date: Sep 2013
Location: Junagadh
Quote:
Originally Posted by jrdemasi View Post
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"
 
const_char
Old
#7  
Junior Member
Thanks Meter 0
Posts: 13
Join Date: Oct 2013
Quote:
Originally Posted by jrdemasi View Post
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.
 
Scalibq
Old
#8  
Member
Thanks Meter 19
Posts: 34
Join Date: Jun 2013
Quote:
Originally Posted by const_char View Post
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).
 
forkan6305
Old
#9  
Junior Member
Thanks Meter 0
Posts: 8
Join Date: 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
 
ty0924
Old
#10  
Junior Member
Thanks Meter 1
Posts: 3
Join Date: Feb 2014
Wink you can get pixel color use this sample code.

Quote:
Originally Posted by jrdemasi View Post
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!

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes