Is there way to convert air-application in flex-application - apache-flex

I need to convert complete .air project to flex project which can run in flash player in browser. Anybody do it?

Look what's inside of .project file. I believe it is set here:
...
<natures>
<nature>com.adobe.flexbuilder.apollo.apollonature</nature>
<nature>com.adobe.flexbuilder.project.flexnature</nature>
<nature>com.adobe.flexbuilder.project.actionscriptnature</nature>
</natures>
Apollo is codename for AIR. If you remove this nature, project may turn into Flex-based. Never did it myself though, so you have to experiment.

That depends on the air-project. I don't think you can get an air-project running as a flex app if it uses air-only features like directory/file selectors or the like ...

Thanks for all. I've built my project by simple copying the files one-by-one and correct the errors.

Related

Unix app to write custom syntax to can check it

well the question is, exist some app or language/etc to write a custom syntax to can check files?
You know, when we works in different places, ppl and projects every one have differents rules to how write, code style and all that things, the idea its can check all this things because at least to me normally i forgot something.
Ideally some app without a heavy GUI, thinking maybe a terminal app, or editors like gedit, avoid plis apps like Eclipse and similars.
For now i need only check simple parts, if you can recommend both a simple/limited app and a complex/full app would be great.
Obvs, if exist a simple/full app, will be better.
Thx.
If what you're looking for is a program that rewrites a source code given a specific coding style, I advise you to take a look at GNU Indent.
If you want to do more complex operations like build an AST and work on it to add things, edit, check for existing dependencies or whatever, you'll want to use a tool like Flex/Bison, Clang, Pyrser, etc.

flex: creating a shortcut to another file/folder

Does anyone know of a method or strategy through which a shortcut can be created through Flex for the various platforms? I've been examining the various flash.filesystem.File methods but did not notice anything that seemed noteworthy.
Thanks for the time and attention.
You won't be able to do it with Flex.
If you target AIR, there is this XXMKLINK program that allows you to create shortcuts from the command line. You can use the native process feature of AIR to leverage it.

How to use FTS in SQLite with Monotouch for iOS

I'm looking to build an iOS app using Monotouch that has a rather large sqlite db full of text. I need to provide fast searching over this text.
My best solution right now is the FTS module (preferably version 4). I have read that the default instance of sqlite on iOS does not support FTS. If this is true what is the recommended way to build a custom instance of sqlite with Monotouch? Or can this be done at all?
I found this site describing how to accomplish this with xcode, but it is not clear how I would accomplish with Monotouch.
http://longweekendmobile.com/2010/06/16/sqlite-full-text-search-for-iphone-ipadyour-own-sqlite-for-iphone-and-ipad/
Any help is much appreciated!
As I mentioned in my comment above I got this working and since Stack Overflow has really helped me out I wanted to contribute a little to give back to the community.
Disclaimer
This is coming from a .NET developer who is a N00B when it comes to iOS/MacOS/XCode/Monotouch.
Although I tested this out on the iPad simulator I have yet to test it out on an actual device.
End disclaimer
This is a quick how-to compile your own version of SQLite and include it in your Monotouch project with the goal of supporting Full text search.
Step 1:
Download the SQLite amalgamation file.
This includes all of SQLite in one file.
http://www.sqlite.org/download.html
Step 2: Compile the SQLite source in Xcode for iOS.
There is a good walkthrough on how to do this here:
http://pp.hillrippers.ch/blog/2009/08/08/Static+SQLite+Library+with+Unicode+Support+for+the+iPhone/
I followed steps 1-5, skipped #6 since we're not adding additional headers.
Instead of using the compile flags used in the walk through I used:
SQLITE_ENABLE_COLUMN_METADATA
SQLITE_ENABLE_FTS4
There may be others you want to add as well.
These compile flags are added in XCode, to the "Build" tab of the project under "Preprocessor Macros".
Once you've compiled this you should have "mylibrary.a".
Step 3: Include this file in your MonoDevelop project
Add mylibrary.a into MonoDevelop as any other file, right click it and make sure the build action is 'Nothing'.
In your project options select "iPhone Build". You need to add additional mtouch arguments. Add the following
-gcc_flags "-L${ProjectDir} -lmylibrary -force_load ${ProjectDir}/mylibrary.a"
Step 4: Build a c# wrapper
You could probably find a good wrapper to include at this point but I just quickly rolled my own.
For a good tutorial on writing an SQLite wrapper in C# check this page out:
http://www.switchonthecode.com/tutorials/csharp-tutorial-writing-a-dotnet-wrapper-for-sqlite
Because your library is a part of the project you don't need to reference the library by name but instead use the "__Internal" keyword. *NOTE THERE ARE TWO UNDERSCORES IN "__INTERNAL" * (Don't ask me how much time I wasted before I realized that)
Here's a sample of one of mine
[DllImport ("__Internal", EntryPoint="sqlite3_open")]
static extern int sqlite3_open_v2(string filename, out IntPtr db);
There's obviously a lot more to putting together a wrapper, but there's lots of info out there on how to do that. One gotcha is to properly marshal the strings you get returned from SQLite. (see http://blog.gebhardtcomputing.com/2007/11/marshal-utf8-strings-in-net.html for more info on Marshaling)
This was intended to be a quick walkthrough on getting a native library compiled in into MonoDevelop/monotouch, and I hope it helps someone.
You would have to do the same thing, build your own libsqlite3.a, and mangle all the public exports so it doesn't conflict with the libsqlite loaded by the system, and then you would need to modify whatever library you want to bind to sqlite to [DllImport ("__Internal")] instead of libsqlite.

Flex 4 Run/Debug Path - How to use Macro/Variable there?

Let's say that I want all my programs under a flex project to go to a new url, with the name of the program's html and swf as variables. Now, normally, it's going to hardcode Foo.mxml to a URL of:
file:///local/wherever/project/bin-debug/Foo.html
But I want it to go to:
http://localhost/elsewhere/?a=Foo.html?b=Foo.swf
Now, I can do this in a hardcoded way by editing Foo.mxml to be the above, but then I have to do the same for Bar.mxml and Baz.mxml. I really want to be able to do (something like) this:
http://localhost/elsewhere/?a=${html}&b=${swf}
And have it fill in the result for me. Then either set that as "the default" somehow, or at least make just one run-debug-setting and reuse it as needed. Any thoughts?
Update:
To clarify, the point isn't specifically to pass in "a" and "b" - yes I can use flash variables or other things. The issue is that I want my own "default" setting that takes the name of the project into account, because the default 'file:///' URL is not appropriate.
Also, yes, I'm using Flex Builder 4.
Are you using Flash Builder? The Command line tools? Or some other IDE?
In Flash Builder, you need to create a 'run' profile for each main application file. I'm not sure how to apply Macros / Variables in that situation. It is a one to one relationship between application and the run profile.
You can use some variables in the HTML template files, though, but off the top of my head I don't i know the complete list of the ones available [and couldn't find a list in Adobe documentation].
Pass them in as Flash vars.

SQLite with MFC

I want to use SQLite within my MFC application.
for that, i'll create an object whose job is to interact directly with the DB(SQLite) to insulate the rest of the app from the DB code.
can anyone point me to a good tutorial ?
i'll need operations such as (create,delete,insert,update,createdb,dropdb and so on...)
Thanks.
There's a page in the SQLite site that lists many available wrappers - here. The C++ wrapper Daniel mentions in his answer is probably the most common one, though it does not support Unicode and the SQLite dll that comes with it is quite dated. There's a Unicode version of that wrapper here, but it's a bit buggy and requires some more work. It could, however, save you the trouble of writing the whole thing from scratch.
Have a look at this. This was really easy to port to MFC classes, but it will get you started.
http://www.codeproject.com/KB/database/CppSQLite.aspx
Or you can just do #include "sqlite3.h", add sqlite3.lib to your linker and use sqlite3.dll directly with the C api. That's what I did in my MFC app.
And you can even statically link sqlite3 into your app. Download the amalgamation and include it! It adds about 400 k.
Please define your problem more clearly.
sqlite can be coding with c, and you can read the sample in their site.

Resources