Android NDK usage - G1 Q&A, Help & Troubleshooting

Hey there, I'm kinda new to android and coding in general, but I was wondering if someone could answer a few questions I had about the android NDK, preferably by someone that has actually used it.
1. How big of a performance boost could I get by using the NDK with a program that is currently runs slow due to a large amount of math processed each loop?
2. How hard is it to transfer data between the java and C/C++ code?
3. Is it possible to get input within the C++ code from the touch screen or keyboard?
Thanks, and sorry if this is the wrong thread for this, I wasn't sure where to put it.

enderx1 said:
Hey there, I'm kinda new to android and coding in general, but I was wondering if someone could answer a few questions I had about the android NDK, preferably by someone that has actually used it.
1. How big of a performance boost could I get by using the NDK with a program that is currently runs slow due to a large amount of math processed each loop?
2. How hard is it to transfer data between the java and C/C++ code?
3. Is it possible to get input within the C++ code from the touch screen or keyboard?
Thanks, and sorry if this is the wrong thread for this, I wasn't sure where to put it.
Click to expand...
Click to collapse
i havent written anything with android yet but i have done java and c++ for a bit so i can tell you that for the most part, translating from java to c++ shouldn't be TOO difficult IMO

Related

How to program?

Hi,
I have an easy question...^^
How can I program programs for my phone?
Is there anywhere a tutorial or something like that?
Or are all of you just very high skilled programmer?
I'm very interested in programming, but I only handl Java and php..
I hope someone of you can explain me where I can learn this =)
Greetings
Chris
PS:I hope I posted this in the right section...^^
PPS: I'm from Germany so I'm sorry for any mistake in my sentences and I hope there is also a German programmer who can show me a tutorial on German, but English is also OK.
I asked this question a few months back and no one helped. Here is what I have been able to find on my own:
To program for your Windows Mobile device you need Microsoft Visual Studio 2005 Standard edition or later. That is an expensive development program. If you buy that program, you can download a Windows Mobile plugin for free that includes an emulator for debugging.
I personally refuse to shell out tons of cash for the ability to program for my phone for personal use. I have not been able to locate anywhere on the internet even the slightest hint of a way that I can write a program for my phone with open source or free software. I use notepad++ and g++ for my coding needs so I was really hoping for a way to program using only these tools with perhaps an additional library.
Speaking of libraries, open gl es is open gl for embedded devices such as your Raphael. I have been unable to find an open gl es tutorial that does not involve buying Visual Studio.
If anyone can find anything else, please post here.
I've used C# and C\C++ to write programs for Pocket PC\Windows Mobile. Java I believe you can use with limited functionality (not the same as on the web). Php is a web langange I believe??
Are you using C++ via Microsoft Visual Studio, or do you know how to compile mobile programs without dropping money in Microsoft's bank?
@Chunkyeggfoo
I know that php is for the web
I only wanted to show, that im not a totally noob in programming ^^
But my question was: Where do you learned this? Did you have an online tutorial, or from school? Or somewhere else...from a book maybe?
Here is one answer to the question.
http://www.codeproject.com/KB/mobile/WiMoSansVS.aspx
I have never followed this guide because I use Visual Studio 2008. I started programming using visual basic .net (VERY EASY TO LEARN). Later, I wanted to write applications for the today screen and I needed to learn C++ and the win32 API. (NOT FUN!!!) The good news is that I have several programs that I use on my today screen including weather, calendar, battery monitor, task switcher, music player and an alarm. It has taken me about a year to become pretty proficient. NOTE: when you move from managed code (.net framework) to unmannaged code (C++, win32) you have to be VERY careful to properly manage device memory or you will end up with memory leaks.
I've attached a picture of my today screen to illustrate the possibilities.
Have fun
Edit
You can also download evc4 and the evc4.sp4 from the following links.
http://www.download.com/Microsoft-eMbedded-Visual-C-/3000-2212_4-10108490.html
http://www.microsoft.com/downloads/...F4-91D3-4DBE-986E-A812984318E5&displaylang=en
This will be a very powerful tool but probably very hard to learn too...
Check out this thread. It has lots of info.
http://forum.xda-developers.com/showthread.php?t=445396
You can take a C++ programming class at most community colleges (not state or UC, ie very expensive). im currently taking the pre req that will allow me to take it next semester.
I think,the simpliest way is the Basic4PPC(Basic for PocketPC). Use Google and search for it.
programming
i guess the best way is learn C#, i'm a visual basic programmer and the best app you can do with it is database app, if you want to do more powerful app for your phone is better to learn C#
i'm learning c# right now
try these two
http://www.smorgasbordet.com/pellesc/
http://trajectorylabs.com/win32.html

Creating Applications...

Just thought I'd double check this before I buy, but it is possible to write applications for this phone using java? Soz if its a stupid question but thats kinda what am needing lol.
No, it's not.
However it should be possible to use the android SDK which sadly kinda looks like Java.
http://developer.android.com/sdk/1.5_r3/index.html
Thanks for the reply. Thats a bit guttin, I thought that android supported java (or a mobile version of java). To be honest I'm just really lazy and dont want to learn a new language lol.
Do you know if android does support java and its just this phone that doesnt? Or is this the case with all android phones?
Irregular Programming said:
No, it's not.
However it should be possible to use the android SDK which sadly kinda looks like Java.
http://developer.android.com/sdk/1.5_r3/index.html
Click to expand...
Click to collapse
What? It's probably not a good idea to go around spouting misinformation like this. "Irregular Programming" indeed.
Perhaps you may like to read through: http://developer.android.com/guide/basics/what-is-android.html#applications
To ExO_PoLiTiX: you won't need to learn a new language, you'll just need to be aware of how the Dalvik (basically the java virtual machine Android runs) system works, and what you do/don't have access to.
My advice would be to read the page I linked above and then go down through all the pages in the side menu. There are also a whole bunch of example projects available for download from that site, all of which can be imported directly into eclipse, provided you've installed the SDK and ADT plugin.
If you already know java you'll find Android development will be a breeze.
iammorris said:
To ExO_PoLiTiX: you won't need to learn a new language, you'll just need to be aware of how the Dalvik (basically the java virtual machine Android runs) system works, and what you do/don't have access to.
My advice would be to read the page I linked above and then go down through all the pages in the side menu. There are also a whole bunch of example projects available for download from that site, all of which can be imported directly into eclipse, provided you've installed the SDK and ADT plugin.
If you already know java you'll find Android development will be a breeze.
Click to expand...
Click to collapse
you dont know how good that is to hear! lol I will have a look through the pages you suggested. Thanks for that. I plan on writing a game which uses the network features of the phone alot. My only experience of creating games is through java so thats why I wanted to use android =-)
Thanks again
iammorris said:
What? It's probably not a good idea to go around spouting misinformation like this. "Irregular Programming" indeed.
Perhaps you may like to read through: http://developer.android.com/guide/basics/what-is-android.html#applications
To ExO_PoLiTiX: you won't need to learn a new language, you'll just need to be aware of how the Dalvik (basically the java virtual machine Android runs) system works, and what you do/don't have access to.
My advice would be to read the page I linked above and then go down through all the pages in the side menu. There are also a whole bunch of example projects available for download from that site, all of which can be imported directly into eclipse, provided you've installed the SDK and ADT plugin.
If you already know java you'll find Android development will be a breeze.
Click to expand...
Click to collapse
Yup, I was wrong.
I was sure I've read about android using its own brand "Java-lookalike" language.
blahzay blah
Irregular Programming said:
Yup, I was wrong.
I was sure I've read about android using its own brand "Java-lookalike" language.
Click to expand...
Click to collapse
You can actually import the main java (e.g. javamail) classes into your projects so android runs almost all of Java.
Follow this link to help you create iphone apps as easy as possible. http://6a7d57q12b9gmv46x4n7rh9m52.hop.clickbank.net/?tid=XDA
Follow this link to help you create iphone apps as easy as possible. http://6fc2862--76bqnb8pfz3nbugtd.hop.clickbank.net/?tid=XDA

Help an old programmer out...

I haven't really done anything on the programming side of things since VB6.0. Learned a bit of C once upon a time, but never really got anywhere.
Can any of you fine Devs here point me in the right directions to begin learning how to program for Android? Remember, please, that I will likely have to unlearn some things, and that I have ZERO JAVA experience. I would love to be able to make some apps to fill gaps that I see in the market.
I am running on a dual boot lappy with Win Vista and Linux Mint 10(Ubuntu derivative). Links or pointers to what I need for both sides will be welcomed and appreciated.
im reading hello android v3 and its great so far.. ive also been going thru android source.. download the android sdk and eclipse for linux and or windows.. i prefer linux as does most devs. ive also registered for night time java classes at the local community college for 13 bucks a semester. anyways goodluck!
This might be helpful for basic syntax stuff.
Start with fattire's link and pick up the Java basics. To read Android examples, you'll need to understand how Classes and Interfaces work as well as how to extend and implement them, respectively. You'll also want to understand inner classes and anonymous inner classes. Understand variable scoping in classes.
Learn how threads work. Understand the implications of multithreading and reentrance. Experiment a lot in simple, stand-alone samples.
Once you've gotten started with Java, you can download Eclipse and the Android SDK. Here's the Android "Hello World" tutorial, which is a reasonable place to start. It has pointers to everything you'll need.
http://developer.android.com/guide/tutorials/hello-world.html
Android Applications are pretty straightforward once you understand the basics... AppWidgets and Services are less so. The trick is to understand the lifecycle of each -- where and when it's appropriate to do what sorts of work and how to communicate results between different components. It will be rough going in the beginning with a fair amount of crashing as you discover you're taking too long to do something that really should be offloaded to a different part of the lifecycle or a whole new thread -- or when you discover you can't do something you want, directly, because you lack the parts and have to send a message to something that does have all the parts.
My first project was a simple button on the home screen that, in effect, runs a few commands. It took me more than a week to make it work properly, and I was already familiar with Java.
Also understand that some of the examples floating around -- even those from Google employees -- are old and that Android has had some growing pains. Double check the approach suggested by anything that's older than a year. The SDK contains sample programs that make for decent cookbook code.
thanks to all of you...as well as the mod who moved the thread to the correct spot...wasn't sure if this was the correct one.
Hello android (as mentioned above) is awesome! Another good one is Beginning Android 2. Both found here:]
Hello Android
Beginning Android

[APP Suggestion] App for my couching classes for timetable

Guys I am new to Windows Phone development as i have just started, so please forgive my mistakes.
I am planning to develop an app, simple app for viewing time table of my classes.
My couching classes regularly updates the time table on their website. And the link can be found here
http://www.professionalacademyca.in/time_table.php
source code
http://pastebin.com/6yUH1Q8t
Questions
1) How can I compile this app?
2) Is this possible or not?
3) if yes, than how?
please give suggestions
DBZo07 said:
Guys I am new to Windows Phone development as i have just started, so please forgive my mistakes.
I am planning to develop an app, simple app for viewing time table of my classes.
My couching classes regularly updates the time table on their website. And the link can be found here
http://www.professionalacademyca.in/time_table.php
source code
http://pastebin.com/6yUH1Q8t
Questions
1) How can I compile this app?
2) Is this possible or not?
3) if yes, than how?
please give suggestions
Click to expand...
Click to collapse
1. You will have to work with microsoft visual studio and windows phone sdk.
2. Yes it is possible
3. You can use htmlagilitypack for parsing the html. This is a very nice tutorial for that.
Ofcourse you should be familiar with programming in C# and XAML. You can easily find tutorials for these.
You could also use the AppStudio, which is an online environment for creating simple apps. It's way less powerful than Visual Studio + WP8 SDK, but it doesn't require a download and it's reportedly very easy to use (I'm used to VS, so AppStudio is no big deal to me, but you may find it more your speed).

Could I use Android Studio to make PC programs?

With that title, you might think I'm an idiot, but I'm just pre-noob. I'm not sure how accurate the question was worded. I'm sorry.
I am just starting with Java. I got a For Dummies book, and read a few chapters for the theory, and now, I'm about to go back to the beginning to start typing in examples for the practical. But I'm confusing myself with all the IDE choices. I plan on building for Android, but also standalone for PC or web or however it works. My problem is the desire to get used to one IDE workflow and layout from the beginning.
Sorry for all the background, but can I follow along with the code in my book and learn the Android-specific stuff later? Or is Android Studio APK specific.
Sub question(and I'm sorry im posting this on an Android Studio forum), but would I be better off with Eclipse/NetBeans from the start?
saneinsylum said:
With that title, you might think I'm an idiot, but I'm just pre-noob. I'm not sure how accurate the question was worded. I'm sorry.
I am just starting with Java. I got a For Dummies book, and read a few chapters for the theory, and now, I'm about to go back to the beginning to start typing in examples for the practical. But I'm confusing myself with all the IDE choices. I plan on building for Android, but also standalone for PC or web or however it works. My problem is the desire to get used to one IDE workflow and layout from the beginning.
Sorry for all the background, but can I follow along with the code in my book and learn the Android-specific stuff later? Or is Android Studio APK specific.
Sub question(and I'm sorry im posting this on an Android Studio forum), but would I be better off with Eclipse/NetBeans from the start?
Click to expand...
Click to collapse
no, you can't use Android Studio at the moment, because it's designed only for Android development.
you should start with NetBeans or Eclipse, and then migrate to Android Studio

Categories

Resources