I wish I could just ask this question in a sentence, but I'm not that concise:)
I developed a cordova app which I turned into a git repo. Later this app turned into 30+ apps -- all basically the same with branding differences.
I decided the approach to use would be to leave my original app as the 'master' and then create branches for each of the branded versions. I would always make edits to 'master' and then pull/merge those changes into each of the branches. They all share 98% of the same code, so that seemed to make sense.
By and large it seems to work ok (on app #2) but I am running into a really annoying thing I can't figure out.
Each time I switch between branches, the platforms/ios and platforms/android directories get bunged up with extraneous files. Since the apps are branded/named differently, some directories/extra files carry over. Even when I go through and remove them I still can't build without errors unless I:
- ionic platform rm ios
- ionic platform add ios
...which is simple enough but I then have to move all kinds of custom native code files in place.. and it seems like I should be able to manage this better.
I tried adding the 'platforms' directory to .gitignore but then ran into other issues. I may have to revisit that method, but is there a recommendation for how I should structure these apps that all use most of the same code?
I just wanna ask you is it possible to compile LaTex in Android app to export a simple PDF. I have not to write math formulas, just a letter.
This question is quite old but just in case anyone has the same question eventually:
As a LilyPond user (LaTeX-like music notation/engraving software), which seems to have less users than LaTeX, I found my best bet to use Termux (you need to learn how to use the terminal a little bit, bash or zsh which are quite similar) and learn to use Neovim as an editor and LilyPond's (LaTeX's in your case) commands for the terminal. As for LaTeX, there's for sure more options like Acode as an editor (which supports syntax highlighting for LaTeX), and has a GUI.
If you go the Neovim/Vim/Emacs route, however, there'll sure be plugins to make both editing (with syntax highlighting and auto completion) and compiling in the same editor.
What is still an issue is probably the PDF viewer, because I haven't found a PDF viewer/editor that has auto-reload function (neither manual reload), so for now (unless someone tells me otherwise) for any PDF viewer/editor you'll need to close and reopen the file to check your changes.
Background
As it turns out, it's quite an annoyance to test out in-app-billing (i've written about it here) . Each time you find a bug and need to test your app, you must have the following steps:
compile the app , preferably with the debuggable="true" flag on the manifest
sign the app with your real key you've created for the play store.
install the app on your device
run the app on your device, preferably debugging it via eclipse.
If you'd use a batch operation instead of doing all of those by yourself, it should make things easier to test such apps, and might also be useful for other apps as well.
The question
Is there any way to make the whole process fully automatic, so that with a single click of a button, it will do all of the above?
I know how to achieve 3+4 (using "adb.exe install -r *.apk" and "adb.exe shell am start -n FULL_ACTIVITY_PATH" ), but I don't know how to achieve the others.
If there is a solution that doesn't involve a third party app or plugin (like maven or Ant), it could be very nice. Of course, if that's what is available, I would like to know if it's possible to achieve via a batch file that will use them somehow.
Is there maybe a way to mimic how Eclipse does things in this regard, without being so specific on the project (maybe just the path of the project and that's it)?
Maybe you can package app by ant . You can do every thing you what int the ant code of packaging ,causing the core code is to make property configs in your app and referenced lib, such as build.xml,local.properties...,and replace channel in AndroidMainfest.xml ,so you can also replace any code in your android app,just as you want ,to change the flag of debug , because all the operation just handle local file before packaging your app,you can copy or modify any file in your app. After above process ,you get a app,then you can run other code to install the app. Recently ,I have been using the batch package method to get a lot of app for different channel .so hope it helps.
Is there way in which I can run an adb command from inbuilt eclipse UI in Android SDK?
I need to find out if ECLIPSE UI already has this functionality, if not need to go about implementing it.
Till now I have been mainly using adb commands on command line.
If there is no such functionality would implementing a Eclipse plug-in would be the best way to handle this?
I want this as a feature, so I have already ruled out the use of "External tools Configuration" which needs to be configured individually for every project an end user builts.
EDIT:
I don't need another console, may it be inside eclipse or outside. What I want to write is a UI which works according to my specific need but abstracts away the command line details from the end user. Now I can still explore on how to do that, but I was looking for an existing example which does this for its specific need,through its UI and abstracts away the details of command line for its own sake.
Well, you could install a shell plugin, to give you access from within Eclipse, perhaps http://marketplace.eclipse.org/content/easyshell
Or even better, you can execute some Shell commands directly from the console. Looks like this SO question addresses exactly how to do that (and best of all, it is built in already).
Is there an Eclipse plugin to run system shell in the Console?
This would allow you to execute any adb commands, as you would essentially be escaping to the shell anyway.
I need to do some menial batch tasks on my phone, and I don't want to jump through all the hoops of making an "app" with a GUI and all that just to do them (the tasks are of the type you'd hack together in BASH in five minutes on a sane system). I can't seem to find any place on the net that explains how to simply make an ordinary program (in any language, but Java is OK if that eases interaction with Android) with access to the Android API that can simply be run by SSHing into the phone and running it as a normal process. No need for an APK package, no need for a GUI, no nothing. This should be the simplest thing in the world, but every example out there seems to be first and foremost concerned with making a GUI and working with Eclipse and the SDK instead of doing the basics first.
Any tips?
(I know this is probably borderline SuperUser, but then again, there's a programming question at the bottom: How do you make an ordinary (Java) program that can be run from the terminal on an Android phone and still use the API?)
Here : Running a shell script on android device using adb
and : https://play.google.com/store/apps/details?id=stericson.busybox&hl=en
and : http://forum.xda-developers.com/showthread.php?t=537827
and : http://strawp.net/archive/recipe-for-a-decent-bash-shell-in-android/
and : http://digitaldumptruck.jotabout.com/?p=938
I can't seem to find any place on the net that explains how to simply make an ordinary program (in any language, but Java is OK if that eases interaction with Android) with access to the Android API that can simply be run by SSHing into the phone and running it as a normal process.
That's because it's not especially important to the bulk of Android users or developers.
How do you make an ordinary (Java) program that can be run from the terminal on an Android phone and still use the API?
You are welcome to use the Scripting Layer for Android to write some scripts, but you have limited access to the Android SDK, and they cannot "simply be run by SSHing into the phone". This is supported by the SL4A team.
You are welcome to experiment with the dalvikvm command, though off the top of my head I do not recall whether or not it is available on production devices, and I do not know if it can "simply be run by SSHing into the phone". And, bear in mind that using this is completely unsupported.
You are welcome to write your own C/C++ code for ARM (or whatever CPU architecture your device runs). This "simply be run by SSHing into the phone" but has no access to the Android SDK.
I still cannot believe that that kind of stuff isn't on the first page of every Android development introduction out there.
There are over 200 million users of Android devices. What percentage of those users do you think want to
"make an ordinary program... with access to the Android API that can simply be run by SSHing into the phone and running it as a normal process"? 0.01%? 0.001%? My money is on 0.0001%.
The "first page of every Android development introduction out there" should be focused on stuff that matters to closer to 100% of the user base. You, of course, are welcome to build up your own site focused on this sort of thing, to cater to those users who are interested in creating these sorts of programs.
From http://git-annex.branchable.com/design/assistant/blog/day_184__just_wanna_run_something/:
While I already have Android "hello world" executables to try, I have
not yet been able to run them. Can't seem to find a directory I can
write to on the Asus Transformer, with a filesystem that supports the
+x bit. Do you really have to root Android just to run simple binaries? I'm crying inside.
It seems that the blessed Android NDK way would involve making a Java
app, that pulls in a shared library that contains the native code. For
haskell, the library will need to contain a C shim that, probably,
calls an entry point to the Haskell runtime system. Once running, it
can use the FFI to communicate back to the Java side, probably. The
good news is that CJ van den Berg, who already saved my bacon once by
developing ghc-android, tells me he's hard at work on that very thing.
and some specific advices in the comments below:
See http://kevinboone.net/android_nonroot.html for info on where in
the android filesystem you have write, exec ability.
Basically you have these abilities in /data/local from adb shell (and
in debuggable app's folders using run-as with adb shell), and in
/data/data// for each app (for example the terminal emulator's
data dir when using the terminal emulator).
...
http://git-annex.branchable.com/design/assistant/blog/day_185__android_liftoff/:
Thanks to hhm, who pointed me at KBOX, I have verified that I can
build haskell programs that work on Android.
http://kevinboone.net/kbox.html:
KBOX [...] gives you the terminal emulator, a
decent set of Linux utilities (supplied by busybox), ssh and rsync
clients and servers, and a few other things. In addition, there are a
number of add-on packages for expanded functionality.
Well, it's just about running an executable on Android, and not about writing an executable that would access Android API...
I can't seem to find any place on the net that explains how to simply make an ordinary program [...] with access to the Android API that can simply be run by SSHing into the phone and running it as a normal process.
An answer, translated from a note by vitus-wagner:
Termux is an advanced terminal emulator plus lots of Unix-like software with command-line interface (in packages managed by APT). Actually, not only CLI (command-line), but also GUI as well (though the GUI software not tried yet).
Unlike the way of the various popular "linux deploy" (which make something like a container, at least a chroot, with things installed into directories according to the traditional filesystem hierarchy), Termux seems to aim at integrating into the host system. For this purpose, it has a plugin, Termux:api which is able to do a lot of interaction with the system: open a file in a native Android app, send an sms, take a picture with the camera, or even say something by means of the system TTS engine.
There are many more addons -- see wiki.
(A side note. An integration like that could be expected--if not from MSYS--from GnuWin32, but there is nothing close to Termux under Windows w.r.t. the degree of integration.
However, for some strange reason, people are asking much more about how to make it more "Linux-like" on the forum, rather than how to use it effectively to solve smartphone-specific tasks...)
A toolkit for cross-compilation is available, so that one can try to package his favorite software.
Actually, it is able to do compilation locally on the device, but it seems not to be able to make a package locally.
Some things to know:
One needs Hacker's keyboard or something similar. One can't live here without Esc, Tab, Control. Or one could try to learn the Touch Keyboard.
vim ran with an encoding different from utf-8, and the Russian letters were displayed incorrectly. So, set encoding=utf-8 had to be written in .vimrc.
ssh to another computer at home couldn't login. The reason was simple: it used the username u0_a95 instead of one's usual username. (One can write User your_username in .ssh/config to permanently "fix" it.)
I'd recommend doing a research on XDA-Developers board