公式转换为Java为Android? [英] Converting equations to java for android?

查看:125
本文介绍了公式转换为Java为Android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名摄影师和我想打一个应用程序为我的摩托的Droid即会
计算我给出了四个输入景深。

I am a cameraman and I want to make an app for my Moto Droid that will calculate my depth of field given four inputs.

我从字面上品牌
新的JavaScript和这种编程的东西,所以我在想,如果
任何人都可以帮助我。

I am literally brand new to javascript and this programming stuff, so I was wondering if anyone could help me out.

我有一个非常基本的GUI设置使用Droiddraw这让我
输入我的4个变量,它们是:

I have a very basic GUI set up using Droiddraw which allows me to input my 4 variables, which are:

焦点(@ + ID / focust)

Focus (@+id/focust)

焦距(@ + ID / FLT)

Focal Length (@+id/flt)

光圈(@ + ID / APT)

Aperture (@+id/apt)

模糊圈(@ + ID / COCT)

Circle of Confusion (@+id/coct)

此计算公式位于这里

例如...

要获得超焦距我需要:((F ^ 2)/(N * C))+ F

to get hyperfocal distance I need to get: ((f^2)/(N*c))+f

所有这些变量将在GUI输入来绘制,但我不知道该怎么称呼他们,如何编写实际的数学,以及如何解决的结果,所以我可以让它们出现在结果区在屏幕的底部。

all of these variables will be drawn from inputs in the GUI, but I don't know how to call them, how to write the actual math, and how to address the results so I can make them appear in the "results area" on the bottom of the screen.

我从来没有做过的java之前我只想让这个程序,因为现有的不适合我的需要。

I've never done java before and I only want to make this app because the existing ones don't fit my needs.

有人能帮助?

谢谢!

推荐答案

如果我没有记错,DroidDraw是构建由Java API使用的XML用户界面描述的工具。如果你想为Android在JavaScript中,像的PhoneGap 计划可能是一个更好的选择。它可以让你使用HTML和JavaScript建立真正的Andr​​oid应用程序。

If I'm not mistaken, DroidDraw is a tool for building the XML user interface description used by the Java API. If you want to program for Android in JavaScript, something like PhoneGap might be a better choice. It lets you build real Android application using HTML and JavaScript.

在另一方面,如果你想使用XML和Java API,那么你或许应该通过Android教程运行。第一个是的Hello,World

On the other hand, if you want to use the XML and Java APIs, then you should probably run through the Android tutorials. The first one is Hello, World.

既然你刚开始接触编程,我不能强调足够的教程。这是真的,你的想法不应该是太难以实现,但你必须先了解的基本知识。

Since you're just getting started with programming, I can't stress tutorials enough. It's true that your idea shouldn't be too hard to implement, but you need to understand the basics first.

我并不是给IM pression一个风格(PhoneGap的与Java和XML)是更好的。你的目的,要么应该罚款。它更是你preFER的问题。的Java / XML是由谷歌支持的模式,并提供了获得更多的功能。在另一方面,如果你已经知道HTML或JavaScript(或有兴趣学习他们),PhoneGap的肯定会提供你所需要的一切。我认为PhoneGap的目的还在于,使初学者更容易,虽然我还没有使用过,所以我不知道他们是如何成功了。

I don't mean to give the impression that one style (PhoneGap vs. Java and XML) is better. For your purposes, either should be fine. It's more a question of what you prefer. Java/XML is the paradigm supported by Google, and provides access to more functionality. On the other hand, if you already know HTML or JavaScript (or are interested in learning them), PhoneGap will certainly provide everything you need. I think PhoneGap is also intended to make it easier for beginners, though I haven't used it, so I don't know how successful they have been.

这是由DroidDraw生成的XML文件不能在PhoneGap的使用。如果你选择使用PhoneGap的,那么你将需要建立接口HTML。你也许能够使用的东西像任何数量的HTML编辑器的Dreamweaver或FrontPage或人帮你这一步。

The XML file that is generated by DroidDraw can't be used within PhoneGap. If you do choose to use PhoneGap, then you will need to build the interface in HTML. You might be able to use something like DreamWeaver or FrontPage or one of any number of HTML editors to help you with this step.

中的XML文件只是一个接口的描述。当你启动应用程序,Android平台使用此说明,以建立您看到的用户界面。一旦发生这种情况,可以从界面到Java或从Java到接口移动数据,没有任何麻烦。你肯定不会由XML接口描述的限制 - 这是pretty灵活

The XML file is just a description of an interface. When you start your application, the Android platform uses this description to build the user interface that you see. Once that has happened, you can move data from the interface to Java, or from Java to the interface, without any hassle. You certainly won't be limited by the XML interface description - it's pretty flexible.

如果你已经经历了Android教程,那么它可能是最好的忘记,我甚至提到的PhoneGap。这是一个完全不同的替代方案,是某些人,某些应用的理想选择。但Android的教程不会帮你去了解它。我只是提出来的,因为你在原来的文章中提到的JavaScript。

If you've been going through the Android tutorials, then it might be best to forget that I even mentioned PhoneGap. It's a wildly different alternative that is the right choice for some people and some applications. But the Android tutorials won't help you to understand it. I only brought it up because you mentioned JavaScript in your original post.

这篇关于公式转换为Java为Android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆