Android Question Recover source code

ansoUzr

Member
Licensed User
Longtime User
Hi:

I have managed to lose my .b4a source file for a test app. Is there a way to restore it from my phone test app using the Bridge or something else?
 

npsonic

Active Member
Licensed User
No.
You can get the APK and use a JAVA-Decompiler to reveal the java-Source. But java is not a b4a code. And when you did compile it with obfuscating then it is more complicated to rewrite the code too.

Get the file from your Backup.
Yeah, like you DonManfread can restore all your lost lib sources from your backup. Just kidding.

Hi:

I have managed to lose my .b4a source file for a test app. Is there a way to restore it from my phone test app using the Bridge or something else?
If source is gone then it's gone. If you lost huge app you may want to check if java file generated by B4A is still there. It doesn't help you to restore the source, but at least you can read it and use it to write your B4A again.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Yeah, like you DonManfread can restore all your lost lib sources from your backup. Just kidding.
Yes. I lost all my sources due to an HDD Crash with no Backup.

But this does make me more sensible and now i have a daily backup running of all my Sources (the hole PC). I investigated a lot of money for a Backupsolution.
 
Last edited:
Upvote 0

Didier9

Well-Known Member
Licensed User
Longtime User
Got lucky! Found the source folder in my Dropbox Deleted Files folder on the web!
Good for you!
I use a mix of backup solutions but I found all the automated backup systems I have tried to have issues. I had a hard drive crash last January 1st on my main machine and while I had most of my stuff backed up, it was a manual thing and I did lose some projects I had been working on during the holidays. A couple of those were for a paying customer so I had little choice. It cost me $1,200 to have the data exhumed from the hard drive. It turns out the drive had been running hot and the head was stuck on a platter. I was lucky the data I wanted ( a few folders) was salvageable but it was not cheap. It took over a month and by the time I got the data back, I had recreated almost all the changes. Somehow, I am more careful now how I backup. Funny how it goes...

I have a global backup using my Google drive account and Google backup. I do not like it too much so I have a second, manual backup for my important projects and for those I religiously and manually backup the day's work to the cloud before going to bed, no exceptions. I also duplicate all my software tools and projects on a second machine and I occasionally run it to make sure everything works. Now losing my main machine would be a minor event.

I do also use Dropbox for some things (like Word documents and spreadsheets) for the convenience of sharing between machines almost instantly, but I have found it is just about impossible to run my C development tools on a Dropbox folder. I suppose Dropbox' eagerness to backup files as they are created interferes with the compiler/linker's job, which is to touch, read, update and create a whole bunch of files in a hurry.
 
Upvote 0

colboy

Member
Licensed User
Longtime User
Yes. I lost all my sources due to an HDD Crash with no Backup.

But this does make me more sensible and now i have a daily backup running of all my Sources (the hole PC). I investigated a lot of money for a Backupsolution.
One of the benefits of saving everything to DropBox. Haven't lost anything in years and I can also simply revert back to previous versions of code.
 
Upvote 0

moster67

Expert
Licensed User
Longtime User
I also like Dropbox i.e. to copy my code there as backups. I wouldn't suggest working directly with your projects in a Dropbox folder though - it is prone to weird errors which are difficult to track if you do this.

That said, I think the best solution would be an integration with GitHub/GitLab or other similar repository services directly from the IDE. In this way, there is a backup but one can also revert to previous code. There are so many solutions these days which are cloud-based and I think B4X would also benefit from this. It would also be a great way to share code and collaborate with other B4X users.
 
Upvote 0

Claudio Oliveira

Active Member
Licensed User
Longtime User
My hobbies are photography and video, so I have loads of files and some of them are really huge.
I decided to use a NAS drive with two 4TB disks configured in RAID-1 (mirroring), and I run a free real time backup software (Yadis Backup). So, every time a file is changed (either its content or its attributes), it is immediately backed up to the NAS server.
I've been using this "setup" for several years now, and never lost a single bit of information, even though a couple of crashes did have occured along the way, in my desktop and in the NAS pool.
It's been a pretty good backup solution to me.
 
Upvote 0

Didier9

Well-Known Member
Licensed User
Longtime User

I support this as it will not only save the most recent version of your work but also previous ones. Sometimes I introduce a bug that only becomes apparent after a few more unrelated changes, so having multiple previous versions (like B4X is doing now with Auto Backups) is better than simply saving the most recent one.
 
Upvote 0

ansoUzr

Member
Licensed User
Longtime User
Check the new auto backup feature: [new feature] Auto backups
I'll look into the Auto backups feature - Thanks.

I use Dropbox for lots of my 'hobbyist' program writing. I have large Visual Basic programs, which I store on Dropbox. I have used the 'version' capability to restore VB forms, etc.

I'm currently using B4a and VB on a Particle development, which also makes use of Dropbox -- and it's free (if you manage your data!).


Thanks again.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…