Android App Dev question - Hero CDMA Android Development

Sooo I am pretty new to the Eclipse IDE, and Android dev. The whole XML Strings is throwing me for a loop, but I am catching on to it.
Anywayz:
I am trying to put 2 buttons side by side.
Each time I drag a new button to the GUI it puts it on a second line.
I am missing something really simple. Gravity doesn't seem to allow more than one button on the same line. Any ideas????
Thanks!

Kcarpenter said:
Sooo I am pretty new to the Eclipse IDE, and Android dev. The whole XML Strings is throwing me for a loop, but I am catching on to it.
Anywayz:
I am trying to put 2 buttons side by side.
Each time I drag a new button to the GUI it puts it on a second line.
I am missing something really simple. Gravity doesn't seem to allow more than one button on the same line. Any ideas????
Thanks!
Click to expand...
Click to collapse
set the linear layout to horizontal instead of vertical... something like..
Code:
android:orientation="horizontal"
inside where you set the <LinearLayout

Thanks!
Side note: Java GUI has always sucked.

Kcarpenter said:
Sooo I am pretty new to the Eclipse IDE, and Android dev. The whole XML Strings is throwing me for a loop, but I am catching on to it.
Anywayz:
I am trying to put 2 buttons side by side.
Each time I drag a new button to the GUI it puts it on a second line.
I am missing something really simple. Gravity doesn't seem to allow more than one button on the same line. Any ideas????
Thanks!
Click to expand...
Click to collapse
What you need to do is create a table in each of your xml layouts that has each drawable in the row...I'll dig up an example and edit my post.
**EDIT**
I misread your original question, you meant buttons not graphics, but here's an example of buttons. Use a table and put them both inside a row.
Example:
<TableLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="center"
android:stretchColumns="*" >
<TableRow>
<Button
android:id="@+id/first_button"
android:layout_width="fill_parent"
android:text="@string/first_button_label"
android:layout_height="50dip"
android:textSize = "17sp" />
<Button
android:id="@+id/second_button"
android:layout_width="fill_parent"
android:text="@string/second_button_label"
android:layout_height="50dip"
android:textSize = "17sp" />
</TableRow>
</TableLayout>
My best advice is to go look at some tutorials and examples, you can find a lot there. You should try your hardest to focus on learning the xml way, as it can really save you some time while developing. There are some good books out there too that go over the programmatic approach.

kmartburrito said:
What you need to do is create a table in each of your xml layouts that has each drawable in the row...I'll dig up an example and edit my post.
**EDIT**
I misread your original question, you meant buttons not graphics, but here's an example of buttons. Use a table and put them both inside a row.
Example:
<TableLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="center"
android:stretchColumns="*" >
<TableRow>
<Button
android:id="@+id/first_button"
android:layout_width="fill_parent"
android:text="@string/first_button_label"
android:layout_height="50dip"
android:textSize = "17sp" />
<Button
android:id="@+id/second_button"
android:layout_width="fill_parent"
android:text="@string/second_button_label"
android:layout_height="50dip"
android:textSize = "17sp" />
</TableRow>
</TableLayout>
My best advice is to go look at some tutorials and examples, you can find a lot there. You should try your hardest to focus on learning the xml way, as it can really save you some time while developing. There are some good books out there too that go over the programmatic approach.
Click to expand...
Click to collapse
I've got the XML down (XML is fun), but the *stupid* problem I was having was in regards to the layout I was using. A Linear Layout is kind of a goofy aproach to default to.
I ended up switching over to a Relative Layout - much more logical to work out if you are just messing around...
I am not sure what kind of app I am writing. For the most part playing around. I typically stick with C++ and C#, java isn't a far cry from C#. But .net let put buttons where ever the hell I want to LOL. I never really understood Java's...well swing's...method of making Windows Forms, the different layout managers just seem like over kill. IMHO

after reading this I am consciously incompetent.
edit. not talking shot on thread just my knowledge and what i would like to learn.
Sent from my HERO200 using the XDA mobile application powered by Tapatalk

sdotcarlisle said:
after reading this I am consciously incompetent.
edit. not talking shot on thread just my knowledge and what i would like to learn.
Sent from my HERO200 using the XDA mobile application powered by Tapatalk
Click to expand...
Click to collapse
At least you aren't over estimating your own skills and admit incompitence. I think they make a blue pill for that.
Either way. Java is pretty straight forward stuff, you just need a good understanding of Classes and Methods. But a good understanding of Classes will come from c++ and a good understanding of Methods will come from weeks and weeks of Hell, and in the case of recursion weeks and weeks and weeks and weeks of Hell(Hell).

Kcarpenter said:
At least you aren't over estimating your own skills and admit incompitence. I think they make a blue pill for that.
Either way. Java is pretty straight forward stuff, you just need a good understanding of Classes and Methods. But a good understanding of Classes will come from c++ and a good understanding of Methods will come from weeks and weeks of Hell, and in the case of recursion weeks and weeks and weeks and weeks of Hell(Hell).
Click to expand...
Click to collapse
i remember when i took AP Computer Science A in high school... learning java wasn't terrible... just a few things.
recursion was absolutely the hardest thing for me and probably the rest of the people in my school to grasp. ugh. the projects that our teacher made us do... it was terrible.
if i remember right, classes and methods weren't too bad though.

justinisyoung said:
i remember when i took AP Computer Science A in high school... learning java wasn't terrible... just a few things.
recursion was absolutely the hardest thing for me and probably the rest of the people in my school to grasp. ugh. the projects that our teacher made us do... it was terrible.
if i remember right, classes and methods weren't too bad though.
Click to expand...
Click to collapse
Recursion is a really simple concept, but usually ends up with me beating my head against a wall because some variable got set wrong in the 3654th itteration, but all up to that point was fine.

Kcarpenter said:
Recursion is a really simple concept, but usually ends up with me beating my head against a wall because some variable got set wrong in the 3654th itteration, but all up to that point was fine.
Click to expand...
Click to collapse
Recursion is bad, especially if you're getting up to 3654 iterations... each time you recurse, you're increasing the amount of stack you use. Recursion may look "cleaner" in some instances, but the stack management overhead usually is at a high cost when many iterations are involved. I had a whole semester class at SDSU which involved evaluating recursive functions and changing into non-recursive.
Recursion with a few iterations is okay, recursion with many iterations is bad.
-Daryel

daryelv said:
Recursion is bad, especially if you're getting up to 3654 iterations... each time you recurse, you're increasing the amount of stack you use. Recursion may look "cleaner" in some instances, but the stack management overhead usually is at a high cost when many iterations are involved. I had a whole semester class at SDSU which involved evaluating recursive functions and changing into non-recursive.
Recursion with a few iterations is okay, recursion with many iterations is bad.
-Daryel
Click to expand...
Click to collapse
It was a slight exaguration lol. But yeah I hate recursion. Try not to use it at all, but I have seen it put in some stupid places causing huge stacks. Gotta love being the new guy and having to sort that **** out.

Related

[Q] Where to go from here? (programming)

I have been programming with Java for about 6 years now. I am currently getting my masters in college for Computer Science (Programming).
I just finished reading the book Hello, Android by Ed Burnette. It was a pretty good book I must say and got me on my feet towards developing for an Android device. For those who do not know the book, each chapter you gradually build a Sudoku game. In the later chapters it discusses some openGL, sound, video. Overall the game is pointless and a waiste.
I never really liked game programming, I wish to do something such as tools, or a feature. However I have hit a roadblock and do not know where to go from here or what to read. I get the structure of the app, the XML setups, etc but the book did not give me a good enough background on the Android System for what I would like to do.
Any suggestions?
Thanks for your help in advanced.
Travmanx I think the way to go from here is use your Java experience to assist in unlocking these phones. I know these guys that are doing the hard work would appreciate all the help they can get.
ZC
I'm very new to android programming too and I agree there does seem to be a big gap in going from the usual tutorials and guides to really getting your feet wet and digging into proper coding.
I think the key here is to think of a simple idea and start to program it, by choosing something simple you can get the basics working quickly, while still giving you room to experiment further with extra features and improvements later on (where the real learning happens).
As to what idea... that is more difficult, I would suggest you do something which you will use so that you've got a drive to keep working on it and improve it.
i.e. If you travel, then a quick currency converter could be useful...if you play tennis then perhaps a score board...it doesn't matter much as long as the incentive is there to code it.
Look forward to hear what you decide to write!
hello there
I would suggest you do something which you will use so that you've got a drive to keep working on it and improve it
Click to expand...
Click to collapse
first of all +10 for ^ meltwater
i did an app to (scoreboard) for a card game, instead of using paper and pen.
then:
i am a Java Developer to,
and recently started doing some android apps
i already have 2 of them in the market...
i am just like you, don't like to do games, i prefer tools and other staff...
however, my point is, whenever you can build an app whatever it is,... all you need now is an idea
try to find an idea and start developing it, and on every problem you face try to dig and fix it, then continue on ur main target... otherwise i don't see any advantage of reading more books, because you have to find something to do, then try to find how to do it (based on your input with 6 years java dev)
otherwise i think you will get lost.
my opinion, find an idea and start with it, then fix every block you face.
Good Luck

How did you learn to code?

Yes I am asking you!
Your personal experience on how you learned coding!
Feel free to vent, my eyes are wide open
my reason? Why I have a book on coding (for Andriod) and the coding package (Eclipse, Andriod SDK, and SO ON)
but is this enough?
How did you start? What was your motivation?
is it fun!?
Please if anyone replies to it, i'd be very happy
Many moons ago, there was a magazine called BBC Micro User, and in it there were pages and pages of code for games written in BASIC.
Normally the code was wrong in places, which meant you had to debug and therefore learn how it worked rather than just copying it verbatum.
This is of course related to our phones as the BBC B was an ancestor to them (now there's a thought!)
Problems? No problems! You need a small program to make your life easier? Go and read in all forums! Ask questions! Start programing by leaning by doing.
Mizulunaris said:
Yes I am asking you!
Your personal experience on how you learned coding!
Feel free to vent, my eyes are wide open
my reason? Why I have a book on coding (for Andriod) and the coding package (Eclipse, Andriod SDK, and SO ON)
but is this enough?
How did you start? What was your motivation?
is it fun!?
Please if anyone replies to it, i'd be very happy
Click to expand...
Click to collapse
Why did you buy a book to find out about technology?!? That book will be outdated tomorrow...I suggest looking up info on the internet and there's this cool thing that's called google that lets you ask any question you want...check it out.
Hope this helped Mizu Luna!
Thank you all for relpying !
think the book is already out dated XD
It was made when android 2.2 just came out....I figured any info toget me startd would be nice.....
I still haven't gotten into the gist of the forum though.....I still don't know many of the terms and aren't familiar to a lot of things talked about...or where things are placed.....and no formal training to help me.....
I guess I'll read on a bit until I can properly place my feet
I couldn't even tell you how I started, I was like 8 years old and just playing around for the hell of it. Been switching around and trying languages ever since. As for motivation, the only reason I ever write a program is because I need something done... I'll feel like I wish my PC/phone/website did something differently - so I make it do that
Really, the best thing to do is just dive right into it. If you want to start with Android, find a good tutorial that at least has you get an IDE and build environment set up... Then from there just start experimenting with some example code, or apps others have written as you go through more tutorials.
If you want to properly learn how to code though, most would suggest starting with something on a PC rather than diving right into Android dev. Starting with an easy-to-use scripting language or interpreter (like Python) is a good way to start playing around - and then you can move on to other languages such as Java with a solid understanding of how programming languages work.
It's all personal preference though, just find a solid tutorial and stick with it. Try to experiment as you go along, try things with the code, and actually understand what it's telling you.
I started with webpage design and slowly moved into other venues. I became interested in making apps for ideas that I had and started to search google on how to code specific tasks that I wanted in my apps and then mixing it all together and making small changes in the code and watching to see what it did.

[Q] Learning coding

I'm looking to learn how to code, mainly because its something that has always interested me but I have never done. I have no experience in it at all. I'm looking for a book that can set me up with the very basics in java (or is it better to start off with a different language?) and hopefully I can move on from there.
If anyone knows of any good books that could help me I would greatly appreciate a link to it.
Thankyou.
http://goo.gl/xB9rK
Why does no one use the search before opening another thread?
Ohnoez
http://www.google.com/cse?q=learn+c...ub-2900107662879704:fs7umqefhnf&ie=ISO-8859-1
Wut?
http://www.google.com/cse?q=learn+d...ub-2900107662879704:fs7umqefhnf&ie=ISO-8859-1
I seriously could not find an answer to your question by using the search function.
http://www.google.com/cse?q=learn+p...ub-2900107662879704:fs7umqefhnf&ie=ISO-8859-1
So even on sophisticated websites like this there are still childish idiots like yourself on them. Yes you're probably right in that I should have searched before creating a new thread, however obviously I didn't think of that.
Maybe next time you should try and show maybe at least an inch of maturity when posting. Oh and for someone who would like me to donate to them and buy/download their apps you're not going the right way about it.
I dont know if that because you joined before me or have more posts than I do, this makes you think you have some superiority over me or new members, but it doesn't and remember with every new member is potentially another donation to you for your work. So if you want to carry on alienating these member towards you then carry on but if you don't then you might want to re-think your mentality towards them, because personally I wont be donating or ever downloading any of you apps.
With that said, thankyou for the links.
SxcKieranGrr said:
So even on sophisticated websites like this there are still childish idiots like yourself on them. Yes you're probably right in that I should have searched before creating a new thread, however obviously I didn't think of that.
Click to expand...
Click to collapse
What you are seeing is my lack of understanding for people creating new threads with topics that have been covered a hundredtimes over.
I'm merely calling you out for your obvious mistake of not using the search.
You made the mistake, deal with it.
childish idiots like yourself
Click to expand...
Click to collapse
Thanks. May i call you lazy idiot?
SxcKieranGrr said:
Maybe next time you should try and show maybe at least an inch of maturity when posting. Oh and for someone who would like me to donate to them and buy/download their apps you're not going the right way about it.
Click to expand...
Click to collapse
I don't want anything from you.
You want something from this forum, more exactly from its members.
You want an answer.
You did not pay anything for the knowledge available for free here, neither the time a member puts up to help you out.
What you could do is show some courtesy by using the search function to not waste the time of people who are willing to help out.
I dont know if that because you joined before me or have more posts than I do, this makes you think you have some superiority over me or new members, but it doesn't and remember with every new member is potentially another donation to you for your work. So if you want to carry on alienating these member towards you then carry on but if you don't then you might want to re-think your mentality towards them, because personally I wont be donating or ever downloading any of you apps.
With that said, thankyou for the links.
Click to expand...
Click to collapse
Both my join date and post count are indirectly related to this.
It just means that i have seen too many threads like this, which could have been avoid by a few seconds of search.
What is more astonishing is that i still browse the question and answer forums to help people out.
Yeah maybe some people won't get the answer they wanted to hear, but hey you got your answer.
Im confused now, from looking around it looks like python is the most basic of languages but if i was to start with a dummy book for that, would it actually help me achieve learning java? I dont want to get the wrong book and be completely lost because I havent learnt the complete basics.
It seems like everyone says different things and I cant get a clear answer of where to start.
@Dark3n I'm not going to sit here and argue, you have your view I have mine let's leave it at that. If you would like to help me (which somehow i doubt) that would be great, thanks.
SxcKieranGrr said:
Im confused now, from looking around it looks like python is the most basic of languages but if i was to start with a dummy book for that, would it actually help me achieve learning java? I dont want to get the wrong book and be completely lost because I havent learnt the complete basics.
Click to expand...
Click to collapse
The most basic language would be machinecode (ASSEMBLER).
But beleive me that it is really painfull to write and learn.
Python is a nice language to write in, no doubt.
But you should think about what you want to do with your programming skills?
Something Android related?
Then you should look at C for linux kernels and the lower levels of android.
or
Java for Apps and the higher levels of the android os.
If you want to learn java there is no advantage in learning python first, besides that you can program in python and java.
I would like eventually to create an app for android, which is obviously done in java but if i got even the most basic of java books would i still be lost?
Edit: I just remembered there was a thread similar to this one where i already had a lengthy discussion about this topic.
http://forum.xda-developers.com/showthread.php?t=1179816
SxcKieranGrr said:
I would like eventually to create an app for android, which is obviously done in java but if i got even the most basic of java books would i still be lost?
Click to expand...
Click to collapse
Not totally lost, you will learn about variables, if statements, loops, classes etc. those things are all still valid when writing apps. Those somewhat remain valid through most of the programming languages.
But basic java does not cover connecting your java code with the android user interface or making use of any android feature (rotate display, sensors, telefon,gps,etc.).
But seriously you don't need a book. Of course you can get one if you really want to. I would probably search the amazon bestseller list for something on android programming (for dummies) which does not require previous programming knowledge.
You can also just jump into it, google for "android hello world tutorial" or something like that.
But the official hello world tutorial should do.
Should make you able to write your very first app pretty quick. It's only a "Hello World" app, but hey thats where everyone starts out.
Aside from the programming itself, knowledge of Linux and *nix orientated operating systems would be useful. Terminal commands and such will prove invaluable if you take application development to a professional level in the future.
C and Java are obviously what's mainly involved in Android. But if you want something simple to begin with look at HTML and CSS (which are basically just translation matrixs not languages).
DeviateDefiant said:
Aside from the programming itself, knowledge of Linux and *nix orientated operating systems would be useful. Terminal commands and such will prove invaluable if you take application development to a professional level in the future.
C and Java are obviously what's mainly involved in Android. But if you want something simple to begin with look at HTML and CSS (which are basically just translation matrixs not languages).
Click to expand...
Click to collapse
HTML and CSS knowledge would help a bit with the android user interface, but not with the actual code of the apps/programs themself.
I would advise the OP not to start with HTML and CSS if he wants to get into the programming buissness.
Unless you are going to make webpages HTML and CSS takes you pretty far of the track.
HTML and CSS knowledge would help a bit with the android user interface, but not with the actual code of the apps/programs themself.
I would advise the OP not to start with HTML and CSS if he wants to get into the programming buissness.
Unless you are going to make webpages HTML and CSS takes you pretty far of the track.
Click to expand...
Click to collapse
HTML and CSS, are two useful skills to have regardless. As you mention for interfacing, and also for the ability to work with Web Apps in the future. For myself learning Javascript and PHP has certainly helped with getting into Java/C.
Certainly HTML/CSS aren't related to learning Java and C but it's a good entrance point to coding in general. Although you yourself may see it as sidetracking, it can help some not to jump in at the deep end.
I wish the OP the best of luck.
Hey dar3n, I had posted a similar thread as well, minus all the attitude, but I agree it does get posted alot, after talking to u and searching around a bit. Why dont u get someone to make a sticky post in one of the newbie rooms, or the q&a. Start a sticky discussion and I bet half these posts dissapear.lol

i wanna make an app.. what do i do first?

how can i make an android app? what are the tools?
You need to install Eclipse, then the Android SDK and then the ADT.
eclipse is easy, I'm using Galileo. Think there is a newer version though.
eclipse.org/downloads/packages/eclipse-ide-java-developers/indigosr2
Then this should help with the rest.
developer.android.com/sdk/installing.html
I started out with a dummies book that walked me through the basics. Then got a game development book that got me in a little deeper. Now most of what I need to understand I get from the Android documentation or stack overflow.
Eclipse is the best for beginners, it's got very sophisticated tools that help you along in many ways.
If you have an idea that isn't too complex, just dive straight in - that's what I did. I started with a very primitive understanding of project management, and basic programming ability (not even any Java, which is the language most Android apps are written in), and I'm picking it up as I go - my main resources are Stack Overflow and the Android documentation. It's worked really well for me so far, it might not work for everyone though.
Start with the back end - use a pencil and paper to figure out the best way to store the data you'll need to store. The content provider is the most important component of an app - unfortunately it's very difficult to make for a novice (I had massive troubles with mine) and much less fun than the rest of the app (I found). Once you finish that, start on the rest. Drawing is a big help for GUI design, and it helps to plan out algorithms you'll use on paper. Keep a notebook handy.
And never be afraid of scrapping it all and starting afresh - most developers do it at least twice per project. Often you approach a problem from the wrong angle, and need a new perspective.
I can't give any more advice, unfortunately, because I'm only a novice myself, but what I've said, I've based on both experience, and things people have told me.
Ravrahn said:
Eclipse is the best for beginners, it's got very sophisticated tools that help you along in many ways.
If you have an idea that isn't too complex, just dive straight in - that's what I did. I started with a very primitive understanding of project management, and basic programming ability (not even any Java, which is the language most Android apps are written in), and I'm picking it up as I go - my main resources are Stack Overflow and the Android documentation. It's worked really well for me so far, it might not work for everyone though.
Start with the back end - use a pencil and paper to figure out the best way to store the data you'll need to store. The content provider is the most important component of an app - unfortunately it's very difficult to make for a novice (I had massive troubles with mine) and much less fun than the rest of the app (I found). Once you finish that, start on the rest. Drawing is a big help for GUI design, and it helps to plan out algorithms you'll use on paper. Keep a notebook handy.
And never be afraid of scrapping it all and starting afresh - most developers do it at least twice per project. Often you approach a problem from the wrong angle, and need a new perspective.
I can't give any more advice, unfortunately, because I'm only a novice myself, but what I've said, I've based on both experience, and things people have told me.
Click to expand...
Click to collapse
This plus stay away from silly books. dont get me wrong there are good books out there just the ones i have read seem to just mess with your head. learn in the style best suits you
omarrq said:
how can i make an android app? what are the tools?
Click to expand...
Click to collapse
Thanks for the post
Sent from my HTC Sensation 4g with Beats Audio
I am gonna start as well. XD
i have got many information form this thread thanks
Probably wrong section but anyways
I think i am going to start as well
Need to contribute back to XDA
i saw JDK 7 as a component needed..
but it says
Other development environments or IDEs
JDK 5 or JDK 6 (JRE alone is not sufficient)
Click to expand...
Click to collapse
will JDK 7 work or should i just use 6 ?
anyways on another note;
Fuzz Ball said:
You need to install Eclipse, then the Android SDK and then the ADT.
eclipse is easy, I'm using Galileo. Think there is a newer version though.
eclipse.org/downloads/packages/eclipse-ide-java-developers/indigosr2
Then this should help with the rest.
developer.android.com/sdk/installing.html
I started out with a dummies book that walked me through the basics. Then got a game development book that got me in a little deeper. Now most of what I need to understand I get from the Android documentation or stack overflow.
Click to expand...
Click to collapse
first post on XDA, registered for this ? XDA is the place you wanna be
Http://android.com
Sent from my Desire HD using XDA

[DEV][Work-In-Progress][C#] Direct Smali to Java converter

DIRECT SMALI TO JAVA CONVERTER​(This is a work-in-progress. Hop in if you can help!)​
Welcome guys!
This project is born because there isn't any reliable way to convert a bunch of smali files into something you can really import into eclipse and compile away. I've lost a few projects in a recent 1 TB HDD crash and man, it wasn't pretty to see I couldn't even get them back with JD-GUI or something. I've done the same with a few .NET projects of mine, so why can't I on Android? you can, but sometimes the tools (JD-GUI or JAD) go nuts and attempting to fix them just gives you a headache so...
Being a smali modder for quite some time, I managed to realize that the entire smali code, if analyzed correctly, it can be converted back to java. We mentally do it when we make smali mods, all I'm attempting to do is to automate the process and make it easier for everyone. Also, it would be really useful to be able to recompile a few Jars and APKs in order to fix device bugs (which is also another reason why I'm working on this).
Some of you would say there is already JD-GUI and JAD, but they're not a real true 1:1 conversion and also most of the times they're not compile-able. Also, There's JEB Android Decompiler but no way I'm gonna pay such a price for something I've been doing mentally and that I can automate with a script made in about a week or a few months. The tool could be great, but the price is too high and my own country's restrictions don't allow me to buy it even if I ever get the money.
The idea here, is to make an app that can translate Smali to Java, directly. Of course, it requires a bit of analysis. It needs to analyze the class directives, the methods and their prologue (parameters, declaration, etc), class annotations and method instructions. So far, I've managed to develop most of the analyzer with a few basic instructions set up for demo purposes.
Of course, I know it needs a bit more work: some variables/instructions don't appear, types are incomplete or missing, etc. But that's why I'm here: I can work on this alone, but, first, it wouldn't be fair. Also, I'm human and by default I have bugs, so I might skip something and make the code go bogus and stuff. And finally, I'd like to request the help of the community. I made this project to see if there's enough attention and contribution from the smart people here, and if there is, I'm gonna give it all to make this project do what it says, 100% error-free.
Note: IT NEEDS .NET FRAMEWORK 3.5. Yeah, and VS 2012. I assume you can make it work with VS2010 or I can make a version soon if there's enough interest, or heck, even Mono as long as it has Linq (I make heavy use of it). The idea is to make a good, open-source parser you can compile even on an arduino with Mono and it will work. But for now, this will have to do. It is my own code and I decided to share it to see if there's interest. If there's enough, I'll do everything I can to provide the tools needed for you guys to help me make this project a reality.
Also, it seems it works with SharpDevelop, so you can compile it under Linux too!
How to contribute:
Source code (active Github): https://github.com/darkguy2008/smali2java
IRC Channel: #smali2java in irc.freenode.net . You can also join us in development chit-chat through web IRC client here.
Fork away!
Well, hoping to attract the attention of you hackers 'round here
- DARKGuy
XDA:DevDB Information
Smali2Java, a Tool/Utility for the Android General
Contributors
darkguy2008
Version Information
Status: Testing
Created 2013-12-31
Last Updated 2014-01-04
Reserved
Thanks for your effort. May I request a small readme or setup guide as I'm generally a Linux user trying this out on my Windows machine?
Sent from my SAMSUNG-SGH-I727 using Tapatalk
This is great, really interested in this, and is the project open source?
robcore said:
Thanks for your effort. May I request a small readme or setup guide as I'm generally a Linux user trying this out on my Windows machine?
Sent from my SAMSUNG-SGH-I727 using Tapatalk
Click to expand...
Click to collapse
Hello!
Oh, sure, here's a small resume but if you need more help don't hesitate to ask
First you need to install Visual Studio 2010 or Visual Studio 2012, I don't know if the express editions work, but they should. Then, if you use VS2010, you need to install the 4.5 .NET Targeting Pack for VS2010 which you can find on the MS website. If you install VS2012, it comes with it preinstalled.
Then, I assume you can double-click the .csproj (project file) and it'll open inside a blank solution that will ask you to save before you can compile it (press F5 to build & run). Also, make sure to edit Program.cs and modify it where it says to edit and put the absolute path of a smali file of your choice (for example, C:\users\you\desktop\someclass.smali). There's no need to put double-backslashes due to the "@" before the string literal.
Also, I think it could also work with .NET 3.5 or 4.0, but I didn't test it as I was hesitant to make something that I could publish on here. Over the next few days I'll keep working on it and keep you guys updated
ricky310711 said:
This is great, really interested in this, and is the project open source?
Click to expand...
Click to collapse
Thanks for your interest! I'm glad and yes! you can download the whole source code and binary from the Download section here in the black top bar over the first post. That's the idea open-source and easy to understand!
darkguy2008 said:
Thanks for your interest! I'm glad and yes! you can download the whole source code and binary from the Download section here in the black top bar over the first post. That's the idea open-source and easy to understand!
Click to expand...
Click to collapse
Thanks will definately check it out when I get home!
Thanks so much, trying it now!
Sent from my SAMSUNG-SGH-I727 using Tapatalk
Alright, I finally learned how to use GitHub (it wasn't that hard... yet, lol), so here's a link for you all to try (it's in the main post, too): https://github.com/darkguy2008/smali2java
Also, I modified the code a bit... removed the whole switch/case stuff for each instruction and changed it to functions. Also, SmaliVM is now the main class where the translation to Java happens. I've also made a "buffer system" because, in smali, you need to process a lot of lines to create one Java line, so every smali line adds up stuff to the buffer (if needed) and it "flushes" on each .line directive. So far, so good.
Fork away and I'm eager to see your pull requests!
darkguy2008 said:
Alright, I finally learned how to use GitHub (it wasn't that hard... yet, lol), so here's a link for you all to try (it's in the main post, too): https://github.com/darkguy2008/smali2java
Also, I modified the code a bit... removed the whole switch/case stuff for each instruction and changed it to functions. Also, SmaliVM is now the main class where the translation to Java happens. I've also made a "buffer system" because, in smali, you need to process a lot of lines to create one Java line, so every smali line adds up stuff to the buffer (if needed) and it "flushes" on each .line directive. So far, so good.
Fork away and I'm eager to see your pull requests!
Click to expand...
Click to collapse
404 not found?
ricky310711 said:
404 not found?
Click to expand...
Click to collapse
Whoops, sorry, fixed! stupid reply box, it ate the "va" in my "java" lol.
It's also corrected in the main post
Very interesting, i can't find a word to say! Congrats man and thanks very much!
http://www.xda-developers.com/andro...onverter-makes-smali-more-developer-friendly/
Good luck with your project
yashade2001 said:
Very interesting, i can't find a word to say! Congrats man and thanks very much!
Click to expand...
Click to collapse
thanks for the support! I'm glad you're interested! any kind of help is welcome
eagleeyetom said:
http://www.xda-developers.com/andro...onverter-makes-smali-more-developer-friendly/
Good luck with your project
Click to expand...
Click to collapse
Oh wow! this is great!! thank you very much!! :laugh::victory: these kind of things really give a lot of motivation to keep projects going! :good: love the review, hehe
I had so much trouble with small files before. I don't really work with them much now. Wish that this was there to help me. Keep it up!
Excellent work man! Confirmed working with SharpDevelop + .NET 4.0 too, 3.5 is not possible since some namespaces used are not available prior to 4.0.
Btw there seems to be a bug in SmaliLine.cs, line 135 where the value 0 supposed to be 1, otherwise keep getting index out of bound error.
Code:
if (sWords.Length < [B][COLOR="Red"]1[/COLOR][/B])
Also i did some modification to the main function, so there is no need to recompile everytime, now i can simply run in in command prompt or with batch file.
Code:
if (args.Length == 0)
{
Console.WriteLine("ERROR: No Input File!");
Environment.Exit(1);
}
String sFile = args[0];
Really hope to see this project get more usable soon. Good Luck!
thehacka1 said:
I had so much trouble with small files before. I don't really work with them much now. Wish that this was there to help me. Keep it up!
Click to expand...
Click to collapse
Me too haha, smali files are a headache... they're kinda easy to understand, but man aren't they harder to read? thanks for the support!
codelover said:
Excellent work man! Confirmed working with SharpDevelop + .NET 4.0 too, 3.5 is not possible since some namespaces used are not available prior to 4.0.
Btw i did some modification to the main function, so there is no need to recompile everytime, now i can simply run in in command prompt or with batch file.
Click to expand...
Click to collapse
Hey man, thanks a lot! It's awesome to know it works cross-platform now don't worry, I just pushed a few commits and lowered the framework version, I assume you can test with 3.5 now.
Also, thanks for the code, I just pushed it to the main repo. I actually refactored a few things, hopefully it's easier to understand and handle now. Also, it now works in a buffer-like way so with some work, it will be able to handle lots of smali instructions in a single Java line as it should be
very interested with this project.. hope it will be a simple to use..
This is awesome! I've been working with MIUI for quite some time now, and their utter lack of source code is both frustrating and difficult to work with. Porting eventually works, but for my current ROM, theirs is based on 4.2.2, where the US version went from 4.1.2 to 4.3. So, it works, but it's still not 100%. I'm going to get set up for this and see what I can do with actual source for some of the screwed frameworks.
As I haven't even downloaded anything yet...how crazy difficult would it be to do a whole .jar or .apk...or ROM using this?
petrukgrinder said:
very interested with this project.. hope it will be a simple to use..
Click to expand...
Click to collapse
Thanks for the support! that's one of the main objectives: it should be
digitalhigh said:
This is awesome! I've been working with MIUI for quite some time now, and their utter lack of source code is both frustrating and difficult to work with. Porting eventually works, but for my current ROM, theirs is based on 4.2.2, where the US version went from 4.1.2 to 4.3. So, it works, but it's still not 100%. I'm going to get set up for this and see what I can do with actual source for some of the screwed frameworks.
As I haven't even downloaded anything yet...how crazy difficult would it be to do a whole .jar or .apk...or ROM using this?
Click to expand...
Click to collapse
Yeah man I feel your pain, I also have the same issue with my ZTE device. Of course the main idea is to be able to get back code from your own APKs-JARs but if it works for fixing bugs or allowing more ports on other devices, awesome.
For now the app isn't even usable, it's a bunch of code which tries to translate maybe two or three smali instructions to java but it's not ready for even a small APK. I assume that the fire test should be trying to convert a whole jar file or two, but it could take maybe a few months for it to do that, depending on how much work the project gets from the community.
hello im also tried to do something like this converter but im stack at "if for etc" also i found this http://forum.xda-developers.com/showthread.php?t=2430413 is very good .
i tried to to talk with developer to help him but no answer yet

Categories

Resources