[Q] Making a new app - need some advice! - Android Software Development

So, here is the situation:
I'm a Magic: the Gathering player and I love to design cards for fun. There is a bit of software called Magic Set Edtior that lets you make and store collections of custom made cards on the PC. My goal is to make a similar program for android. However, I'm relatively unfamiliar with how android apps are developed, and I have one major problem starting out:
Basically, the program needs to be able to open, create, edit, and save sets of cards that each have a few features. How do I store data for these sets? How would I accomplish that sort of file system? Should I just have the app create a internal database for each set the user makes? Are there limits to how many databases can be created by a single app? I'm probably not being as clear as I could be, and I realize that this project is probably (far) beyond my abilities - but I'd appreciate any help and would be happy to clarify anything that doesn't make sense. I'll post progress once I get this off the ground!

Check out the notepad demo at developer.android.com, it should be a good starting point for what you are trying to do

Sweet! I'll take a look. Thanks for your help ^_^
One more thing about databases, then: If the app has an internal database and I release an update for the app that modifies fields in the database, does the information get wiped? (for example, say that the tables in the db have three fields: name, cost, rules, and i issue an update that adds a "stats" field. Would that clear out the current cards in the database?)
Basically, I just want to be sure that using databases to store the sets of cards is the best, most efficient way to do this (So I won't end up having to re-code that entire bit of app).

So, databases are confusing... At least, how android works with them sure as hell is @[email protected]
So, what ive got now is that I need to make a database to store the individual card data... however, I also need to store general information about the set as well. So, do I make one new writeable database per set created, or is there a way to just use one database, and one table per set? (though I dont think you can store general info about a table that applies to each row, can you?)

Or apply for appinventor from googlelabs. Its fast and easy, should suite your purpose. Also has ability to communicate via web.
goodluck

I did apply. I'm hoping they get it too me soon.

Roid1 said:
Or apply for appinventor from googlelabs. Its fast and easy, should suite your purpose. Also has ability to communicate via web.
goodluck
Click to expand...
Click to collapse
I've got accepted like a week ago. Sad part is. You can't upload apps made to the market
sent from my pimp hero running Froyo CM6 and the XDA app

Related

MobilMon - File system monitor utility

To the many excellent folks here at xda-developers.com, I'm releasing MobilMon 0.5 for free.
I wrote a simple app that monitors file system access (specifically, file creation, deletion, or modification). This sort of tool can be invaluable when you are trying to figure out what's happening on your system. You can export the findings to a log file.
It's pretty bare bones at this point, but that was somewhat intentional. I wanted to see what folks wanted out of such an app before spending more development time on it.
Check it out, and let me know what you think: http://www.mobilmon.com
wow! thank you! this is pretty much exactly what i was wishing for ever since i started playing around with new apps and such on my phone.
it's a great help for just before a system backup. for example, i have SPB backup set to run every other morning. let's say it runs on Saturday at 5:00am. I install some apps and do some random things from 8:00am to 9:00am. 9:30am, my phone crashes. I reset to 5:00am, and I lost all that stuff i did from 8 to 9. now i know! thanks for this app.
Feature changes
A couple of things I was considering:
1. CSV EXPORT. Would it be better to leave the plain text formatting for easy readability, or format it for CSV export?
2. DIRECTORY. I was originally going to include the ability to change the directory (i.e. something other than just "\") but that would involve some significant work on my part. And, I'm not sure if you'd really want to do that anyway.
3. VIEW FILE READS. As delivered, it monitors file adds, deletes, and changes - not reads. This was done intentionally for performance reasons. Would people want to see all the file reads, even if it bogged the device down?
This is awesome! I haven't seen anything else like it, so I am really happy to see someone from the xda-forums to make this magic!
I think that you should add in the view file reads, but only as an option. Maybe also an option to select which operations you want logged (eg. when I only want to see the files created, and not deleted). Although being able export to CSV would give me the same results, but with some editing.
3. VIEW FILE READS. As delivered, it monitors file adds, deletes, and changes - not reads. This was done intentionally for performance reasons. Would people want to see all the file reads, even if it bogged the device down?
Click to expand...
Click to collapse
Many thanks for the app.
It would be nice to have (even as a separate app) something like mamaaich's file monitor: http://forum.xda-developers.com/showthread.php?t=247425, with ability to start/stop and good frontend - to capture all file activities in the whole system.
It helps a lot to find frequent, unintended system file reads (in most cases - draining batteries)
monitor lost memory
i wonder if you could add some powerful memory mgmt to check where my pda memory is lost and what is the process,application or service which is causing memory leaks or using too much memory. maybe you could draw a graph or monitor memory usage during time for all processes. when i start my pda i have 48% free ram, after a day i am back to 80% without any visible app running.
Thanks!
Thanks
Thanks for the good feedback; I'll look into making it where you can select the types of events to monitor and then go from there.
Good lead on mamaich's program - I wasn't aware of it. I will take a look. I'm all about working smarter, not harder
Hello,
I stumbled over this (admittedly quite old) thread on the search for a windows-mobile version of something like iTunes FolderWatch or iPad ShutterSnatch.
Would it be possible to extend MobiMon such that an action can be triggered once a new file is found? In my case that action would be to start a picture viewer with the newly created file name as a parameter.
Scenario: Send pictures I take with my camera to my Windows Mobile Phone (HTC HD2) via FTP (MochaFTP) through an Ad-Hoc Network directly from the camera (using Eye-Fi). MobiMon would recognize the new file and fire up the picture viewer. This way, the latest picture taken will be shown on HD2's big display right after the shot was taken.
Of course, if there is a more streight-forward way of doing this (like a picture viewer with integrated FTP-Server ) I'd be more than happy to hear about it!
Regards and a happy new year!
Alex
Yes, it's possible.
In regards to your inquiry, it's programmatically possible, but would require a re-write. This has to do with the way things are instantiated. Whether I could afford the time to do it is a different question
1. What is the target OS?
2. Do you have the means and skills to adjust my code and compile it yourself if I just pointed out the changes needed?
allright, heres my question:
is it possible to add (i.e)tray/taskbar icon showing card r/w activity?
I am thinking not exactly about this specific project, but general idea related to it.

Kick ass apps wanted

Need an apk that signs my update.zip files from titanium blackup.
I don't understand why it hasn't been done. The code to do it is already in java! Search the forums for testsign.jar
I know everything you need to do to get it done but I don't have a development environment at my disposal. Help me out and I'll show you how to convert your jarred up code libraries to run on android!
Please and Thank You.
* edit - this question has been solved by brainmaster! ZipSigner if you find this application helpful please thank him below.
- Posted via mobile
New application proposal: ZeroNetAccess (ZeNA?)
Concept: an app that can block other apps network access.
Market alternative: DroidWall (root only, low market potential)
Methods: Maybe by modifying the apk manifest and resigning? Im not sure if there is a framework you could subclass for this.
Why: i turned off stats reporting for an app and i saw it writing reports to the web from logcat. Google took our rights away by not letting us do this from the application settings. Its my device and i have to pay the bill not google or the rude ppl who made the app. I will never understand why we were not given the right to administer mobile data access rights.
Potential: highly lucrative. People want to save money nowadays. In that respect voiding phone warranty for root access may not sit well with potential customer.
- Posted via mobile
Avid Droidery said:
New application proposal: ZeroNetAccess (ZeNA?)
Concept: an app that can block other apps network access.
Methods: Maybe by modifying the apk manifest and resigning? Im not sure if there is a framework you could subclass for this.
Why: i turned off stats reporting for an app and i saw it writing reports to the web from logcat. Google took our rights away by not letting us do this from the application settings. Its my device and i have to pay the bill not google or the rude ppl who made the app. I will never understand why we were not given the right to administer mobile data access rights.
Potential: highly lucrative. People want to save money nowadays.
- Posted via mobile
Click to expand...
Click to collapse
For rooted devices try DroidWall
Application Proposal: Web Page to PDF/HTML Safari Plug-In
Concept: Seriously?
Why: Cant save pages from the browser I safari always reloads the page when you come back to it from other activities (pointless nethog!) whats the friggin cache for anyway? It is better to save an article copy that you could view on the computer later or add to your info library if you write books or do any kinda technical research than it is to save a bookmark that may become 404 not found. Researchers nightmare!
Methods: execute shell command wget on page source. Use regular expression to get media list. Build directory tree. For each media call wget. Done.
Potential: medium. Not many people are so technically inclined.
Usefulness: extremely high, especially with zip/+email caps.. Roundabout source code viewer for nosy/curious folks.
Average potential, stream lehigh usefulness I would sell for a buck 99. Free (1 ad per saved page, no zip email)
- Posted via mobile
3rdstring said:
For rooted devices try DroidWall
Click to expand...
Click to collapse
Thank you! Will do!
- Posted via mobile
Application proposal: WarBastard
Concept: wardriving app featuring google my maps! Maps are shared globally by locale. Signals can be pinpointed by triangulation through cross reference of mac address, signal strength and previously detected locations in a global locale based database. While we are at, throw in a google navigation intent, and a compass with distance to closest accesible AP! Dont stop there! I wonder where that cell tower is located?
Purpose: to aid weary travellers and cheap bastards to connect with their loved ones and services over open networks. Services could also be used for cellular network signal diagnostics across hundreds of thousands of devices.
Potential: astronomical I would pay 5 bux. Better yet 12 bucks per year. Free (1 ad per download of database, 1 ad per connect to AP. Possibly integrated with APs for increased revenue potential across the board.) The map data can also be used to find good places to set up an advertising AP 4 even more potential earnings.
Anybody wanna pay me to sit around and do this all day? Lol.
SERIOUSLY you are looking at my qualifications. Asking 50k p. yr. to start Project Mgr./Analyst/Sr. Developer. consulting options available. Willing to relocate. Pm for inquiries/proposals.
- Posted via mobile
Avid Droidery said:
Need an apk that signs my update.zip files from titanium blackup.
I don't understand why it hasn't been done. The code to do it is already in java! Search the forums for testsign.jar
I know everything you need to do to get it done but I don't have a development environment at my disposal. Help me out and I'll show you how to convert your jarred up code libraries to run on android!
Please and Thank You.
- Posted via mobile
Click to expand...
Click to collapse
You should use the search function: ZipSigner.
It implements in the Titanium Backup and signs it on your wish.
brainmaster said:
You should use the search function
Click to expand...
Click to collapse
You are correct. I should never have assumed that this wasn't already in the market. Actually I didn't really plan to use this to sign titanium backups. For my purpose however the concept is the same.
* edit Human beings arent the fastest search engine but collectively we are the most accurate information sources on the planet. feel free to quote me on this
I thought that it would be better to ask someone who might know than it would be to search for something that may not exist. If I had access to a computer I would have no questions to post. Only answers! Being that I am stuck on my android for the time being, I appreciate all the help I can get!
Thank you for providing me with another helpful for resource!
* Edit: Dear brainmaster, words cannot express my level of gratitude! I am truly overjoyed by the passing of this shortcoming. Signapktic is exactly what I was looking for and I never would have found this application had it not been for your assistance. The topic of this thread is kick ass apps wanted. Even though this is an application that no longer needs to be developed (because real developers don't reinvent the wheel unless absolutely necessary,) you have met or exceeded the topic issue with flying colors!
- Posted via mobile
New application proposal: Launchpad Homescreen Widget
Concept: a widget that will pop up an on screen menu (complete with icons) onClick similar to pc desktop start menus. Customizable shortcuts Horizontal or vertical (and scrollable) layouts by preference and Customizable folders.
Why: I would rather have a feature like this than an app drawer any day. This would allow individuals to organize launcher short cuts by task. It would also be great if it were possible to open files in the system such as pdf, video, music or text files with appropriate application. Another great feature would be the ability to launch shell scripts. I have searched the market and nothing like this was found.
Potential: high. will save customer time allow them to become more visually organized and task oriented as well as adding more visual appeal to the home screens. $5.99 I would buy it! Time limited trial only.
- Posted via mobile

Developer with a Marketing question!

I'm a programmer; I don't do Sales, I don't do Marketing LOL
I'm working on an app that has my partner and I debating on pretty much a daily basis. I'll try to explain best as possible without too much detail.
The app takes a pre-loaded database (a "template") from assets folder and loads into the app. Works fine. Thing is, there will be more templates, probably up to 20 for which we want to charge (we're talking small amounts here).
So, here is the debate we're having:
1. Create 20 apps with each having the one template. Easy as hell for me but goes against my programming standards as to why have 20 apps when ONE does the work? NOTE: Does not need any permissions
2. Create one app, ask user for template on startup, download from cloud. A little tougher, but not much. Problem here is that what if they want 2 templates? Or 5? We want to charge for each template. I could do "AppName +2" or "AppName +5"
versions and charge accordingly. NOTE: Max templates a user would have is probably 5.
3. In-app purchasing...I've read about this. Not so easy. You either hide content (and over bloat your app or code a mechanism that allows Joe to have in-app purchase app, but not Julie). Google makes clear note of this in their docs. NOTE: my bloat would be about a 7,000 row database on user's phone.
So, just looking for some other opinions...all comments welcome!
TIA,
Roots
From what I can understand, I think # 1 is the most tried and true method, as most launchers with themes work this way. The upside for you as far as making money is concerned is that there are people who want all their options, whether or not they will ever use them... I have been guilty of it myself with lp+ themes. I've paid for ones I'll never use, because it's there and most apps tend to be in the "impulse buy" price range.
I agree, #1 is your best option, it may require a lot more work as far as deploying goes, but it is the most reliable method.
Interesting! Thank you for your replies.
A little more information...the templates (e.g. database) will probably never change from initial download, so that update is a moot point.
One thing I didn't think about is creating and SAVING 20 keys!!! Yikes. I've lost those before...very bad situation when that happens. Not to mention 20 distinct package names.
One thing I didn't think about is creating and SAVING 20 keys!!! Yikes. I've lost those before...very bad situation when that happens. Not to mention 20 distinct package names.
Click to expand...
Click to collapse
You can sign all packages with the same key.
As of package names, all you need is to change the application package not the code packages. The ADT has a tool for renaming application packages.
1. Create 20 apps with each having the one template. Easy as hell for me but goes against my programming standards as to why have 20 apps when ONE does the work? NOTE: Does not need any permissions
Click to expand...
Click to collapse
Here is my suggestion, although I never tried it:
Create 20 apps for templates with no logic at all.
For each one of these apps:
(1) Put a single template file in the res/raw folder
(2) Create an Activity that doesn't do anything at all (call finish on onCreate).
(3) Set intent-filter for your null activity with android.intent.action.MAIN and your own custom category.
Create 1 main application with all application logic and code but with no templates at all (or just one default template).
(1) Search for installed templates using PackageManager.queryIntentActivities with an Intent that match Intent.ACTION_MAIN and your custom category.
(2) Read templates using Context.createPackageContext, getResources of the created context, getIdentifier to find the id of the template file and openRawResource to actually open it as an InputStream.
There are other methods to share resources, take look at android:sharedUserId.
Interesting concept, but if I read it right, I sill need 20 "dummy" apps to go with the main "driver".
I've got some time to mess with this because I have to implement drag and drop on some ListViews. I might just end-up coding the in-app purchase stuff.
EDIT: LOL, I can't wait till I can afford an iPad and port all my stuff to iOS

[Q] Corporate Android Usage

Hello Guys,
before I start: My apologies for this, I am not quite sure if I am even in the right Topic.
I think of myself as pretty new to Android, but got some experiences in Rooting, Custom Roms and such. But that is already as far as it gets.
Now my Problem: We lost our BES and now my Company decided to go with Android (SG4 I9505) and I have to make it happen :angel:.
1. I Need some Kind of Freeware tool to administer Android Devices (Basic: find device, delete data, restrict Apps)
2. If something like this dont exist (which I dont think-I just havent found it)), I would Need to know if I can use CM 10.2 as our Standard Rom and before you start rolling your eyes with experimental and such....
I have to restrict the phone solely to Telefone, Exchange and some preselected (mostly travel)Tools. NO GAPPS!!! and I think that nightly CM provides this with no problems
To realize this I downloaded the nightly from 18th, I think. I then added some APK´s into \System\app Folder and installed the ROM. This actually worked fine until I updated to phone afterwards via build in updating tool - all Tools were gone.(what did I miss?)
Now, our Standard is SG4 I-9505.
Any ideas on how I could do this? (I couldnt find what I was looking for)
1. Adminster a fleet of androids (free)
2. Customize a Custom ROM for corporate Identity (How to pre-setup Exchange Boot Logo, Lockscreen, etc.)
3. or customize a ROM to the Point it cannot do much except what is in the \System\app Folder and turn off updates
Any link is much appreciated. Sadly there is sooooo much andoid articles out there that I seem to get lost while searching for the right one. Thanks in advance!!!!
AccEss-dEniEd said:
1. Adminster a fleet of androids (free)
2. Customize a Custom ROM for corporate Identity (How to pre-setup Exchange Boot Logo, Lockscreen, etc.)
3. or customize a ROM to the Point it cannot do much except what is in the \System\app Folder and turn off updates
Click to expand...
Click to collapse
My guess is I'll get flamed for saying this - but here goes.
Android corporate (MDM) leaves a lot to be desired next to iOS, at least as far as I've been able to find. We manage a lot of iPads and obviously minus the custom ROM we've been able to do it all for little to no cost. We've shied away from Android a lot because of the limited MDM control.
But, since you asked:
1. Meraki Systems Manager (and the accompanying app from Google Play)
2. Good luck with that
3. See number 2
I think the reality is you're going to need to do something to the effect of either cook your own ROM and deploy it or use a tool like CWM to create an "image" that you would then restore to the devices. I did that with a batch of 60+ Nexus 7s and it worked out pretty well.
Edit:
With all that said - I would urge your management to reconsider their approach as the world has changed since Blackberry was the only game in town. Yes, still stick with MDM, device location, remote wipe etc. But unless you're dealing with highly sensitive information (exp banking), let people actually USE the device you're giving them. Don't lock it down to where its basically a first generation iPhone. I'm a big fan of giving someone a good tool and letting them use it the way that works best for them, while still keeping the device and more importantly the data under corporate control.
Assuming you have Exchange, does this not provide the management part?
AccEss-dEniEd said:
Hello Guys,
before I start: My apologies for this, I am not quite sure if I am even in the right Topic.
I think of myself as pretty new to Android, but got some experiences in Rooting, Custom Roms and such. But that is already as far as it gets.
Now my Problem: We lost our BES and now my Company decided to go with Android (SG4 I9505) and I have to make it happen :angel:.
1. I Need some Kind of Freeware tool to administer Android Devices (Basic: find device, delete data, restrict Apps)
2. If something like this dont exist (which I dont think-I just havent found it)), I would Need to know if I can use CM 10.2 as our Standard Rom and before you start rolling your eyes with experimental and such....
I have to restrict the phone solely to Telefone, Exchange and some preselected (mostly travel)Tools. NO GAPPS!!! and I think that nightly CM provides this with no problems
To realize this I downloaded the nightly from 18th, I think. I then added some APK´s into \System\app Folder and installed the ROM. This actually worked fine until I updated to phone afterwards via build in updating tool - all Tools were gone.(what did I miss?)
Now, our Standard is SG4 I-9505.
Any ideas on how I could do this? (I couldnt find what I was looking for)
1. Adminster a fleet of androids (free)
2. Customize a Custom ROM for corporate Identity (How to pre-setup Exchange Boot Logo, Lockscreen, etc.)
3. or customize a ROM to the Point it cannot do much except what is in the \System\app Folder and turn off updates
Any link is much appreciated. Sadly there is sooooo much andoid articles out there that I seem to get lost while searching for the right one. Thanks in advance!!!!
Click to expand...
Click to collapse
I currently work in the infrastructure of a good sized corporation. We're using IOS with a mixture of android hardware and there's some good news and bad news for what you want to do.
Good news is, like Jpcurrie said, exchange will handle remote wiping and locking the phone down. you can require the phone to use a PIN, remote wipe and and a bit more. As for locating the phone, Google actually has finally built in remote locating of your device and remote wipe as well. There's a couple good apps out there (lookout) will turn on your GPS and allow you to locate the phone and they're free. If you happen to have a virtualized environment with VMware, you could also use VMware View Horizons which builds in a secure sector on the phone and you can remotely manage which apps and files the user can use. the best part of View is you can use a BYOD model and keep corporate data secure. The biggest issue is if you don't happen to already use a VMware architecture it gets pricey quickly.
Here's the rub now. you want to install your own logos on the bootup which you could do by installing a custom ROM. This will void your warranty on the hardware and as it isn't 100% stable you'll be spending a LOT of time trying to keep a consistent environment.
Like netsyd said, talk to management about an MDM, and the branding of the devices, maybe even talk to them about using a BYOD to reduce costs of hardware and administration of that hardware.
Isn´t Knox supposed to allow administrators to only delete the data that belongs to the Corporate account (emails, calendars, tasks, etc.), or an administrator can still force a full device wipe? Sorry if the questions is too basic, I've tried searching around for info on Knox but couldn't find anything besides press releases.
I'm not a network administrator, I'm just a user and my school secure wifi installs a device administrator.
I'm sorry to deviate the topic a little bit from the original.
At Delta we use Air Watch but it's far from free. You can however manage devices and remote wipe. You can also view installed apps and remove what should not be there. Options for device profiles also. I help maintain these devices everyday. Not Free but an MDM is your best bet.
Sent from my SAMSUNG-SGH-I337 using xda app-developers app
long time - no see
Hiya,
sorry I didn t answer - kinda was overwhelmed with this Task.
Wanted still to thank you: I did what you suggestet and wanted to let you know where I am now.
1. Meraki = implemented - now runnning 160+ devices. (at no costs)
2. CM12.1 implemented (without GAPPS/no SU)
3. Standard Image/w Apps defined. (Mostly Offline capable Tools like "here" etc.(which actually reduced costs))
4. Since Android has limited capability to be administered in a "real" professional Fashion we mitigated this issue by creating a policy to forbid the user to temper with the device (e.g. Installation of Software/SU etc) yet to allow the Installation of Software manually by us via creating a ticket. We check the Software mainly for "sanity" and malware and install it if ok.
This has been working so far like a charm for us. None of the user were happy to loose the Gapps obviously - but once they had their Software and settled in, all was ok. For the Administering part: Meraki can tell me if Software is beeing installed without our Knowledge, also we see if SM doesnt speak with us anymore. So, for now, we got the most out of the System and I am happy to say: I got minimal Control in a Quality sense. No no more "KO Critera" - and we have implemented Android. Tracking etc. is forbidden in Germany anyway - so we use Meraki mainly to wipe if lost and to check if someone goes against policy.
What is still open:
- I am still working on a way to have the user enter his credentials and automatically enter These in all respective config files. (haven't had much luck - with the absense of SU obviously.
- a Little cosmetics still open (I am still trying to figure out how the theming really works ... I usually f**k up the Pictures and sounds.... but so far making Progress
- with less and less good Android devices coming out (now, I am probably beeing flamed now ) that suits our needs (open bootloader, known/supported CPUs, removable battery, SD Card Slot) - I think we might Switch by Q4/2016.
netsyd said:
My guess is I'll get flamed for saying this - but here goes.
Android corporate (MDM) leaves a lot to be desired next to iOS, at least as far as I've been able to find. We manage a lot of iPads and obviously minus the custom ROM we've been able to do it all for little to no cost. We've shied away from Android a lot because of the limited MDM control.
But, since you asked:
1. Meraki Systems Manager (and the accompanying app from Google Play)
2. Good luck with that
3. See number 2
I think the reality is you're going to need to do something to the effect of either cook your own ROM and deploy it or use a tool like CWM to create an "image" that you would then restore to the devices. I did that with a batch of 60+ Nexus 7s and it worked out pretty well.
Edit:
With all that said - I would urge your management to reconsider their approach as the world has changed since Blackberry was the only game in town. Yes, still stick with MDM, device location, remote wipe etc. But unless you're dealing with highly sensitive information (exp banking), let people actually USE the device you're giving them. Don't lock it down to where its basically a first generation iPhone. I'm a big fan of giving someone a good tool and letting them use it the way that works best for them, while still keeping the device and more importantly the data under corporate control.
Click to expand...
Click to collapse

Way to store Preferences

Hey Guys,
I am creating a app to rename other apps via xposed and the main code is written. Now I simply want to make a interface where you can define a app to rename and then enter a new name. For the beginning I thought about a Activity where you enter the Package Name and the desired name. Later on I want to use a list view to show all apps, from where you can choose one to rename(Like App Settings etc.). To show the renamed apps I want to use a ListView. Now I am stuck with a problem: My xposed code works with an array to check and rename. The list view can be used with an array or an arraylist, but I need a way to store the preferences(which are stored in a array).
Do you have a good idea or a sample how to realise this? And does somebody know a nice App List type of thing(I googled, but the project there aren't usable with my kind of approach.)
GalaxyInABox said:
Hey Guys,
I am creating a app to rename other apps via xposed and the main code is written. Now I simply want to make a interface where you can define a app to rename and then enter a new name. For the beginning I thought about a Activity where you enter the Package Name and the desired name. Later on I want to use a list view to show all apps, from where you can choose one to rename(Like App Settings etc.). To show the renamed apps I want to use a ListView. Now I am stuck with a problem: My xposed code works with an array to check and rename. The list view can be used with an array or an arraylist, but I need a way to store the preferences(which are stored in a array).
Do you have a good idea or a sample how to realise this? And does somebody know a nice App List type of thing(I googled, but the project there aren't usable with my kind of approach.)
Click to expand...
Click to collapse
Ah the data storage problem... I think we all came across this at least once . I suppose you read this guide on the different options available? Well there are actually three options: SharedPreferences, text or csv file and SQL.
The first one would need some work around and is probably the slowest. You would save a separate string directly into the SharedPreferences (maybe in a new file to avoid collisions?) with the array name and its index somehow in the key. That's just two methods of coding but not the nicest way to do it.
The text or csv file however is the more common way, here you'd save your array in one line of the file, each item separated with a ; or some other char. Needs a bit more coding and also the WRITE_EXTERNAL_STORAGE permission on preKitKat if I remember correctly.
The third one is the nicest and most modular one. Because it makes use of SQL it needs quite a bit of knowledge and some coding (but less than the text file).
I guess for simple things that you want to do it is better to stay away from SQL for now unless you know how to use it and use the SharedPreferences.
Edit: take a look at the answers to this question, they give you the code as well... And you can use StringSets in ICS and above if the order of your list doesn't matter !
I'd say go down the SQLite DB way, chances are that if you plan on expanding your coding knowledge and want to keep creating apps you'll be needing to learn this in the future anyway so why delay?
Google AndroidHive and look at their SQL tutorial - I used it when learning and found it very informative
Sent from my HTCSensation using Tapatalk
Thank you very much! As coming from windows, first of all I thought about SQL as well, but it seems oversized for the set of data i want to store. I also took a look at the stackoverflow thread you linked. It looks easy to implement, but the need to use an external class file made me look for another way. I found this one, which works pretty well for me, as I look forward to interchange the method of saving the data with a better one using the SharedPreferences(which actually should be really easy with my code).
Maybe you can tell me yet another thing: Is there a way of declaring an object(like the ArrayList) to make it accessible from every class except from giving every class(activity) it's own "load the preferences" and "save the preferences" code block or sending intents all over the place? This would make saving much easier and allow me to update the preferences during runtime and without a reboot
Edit: This was my answer to.SimplicityApks ^^ I'll take a closer look at SQL now, since you, Jonny, told me that it' nevertheless necessary.
GalaxyInABox said:
Thank you very much! As coming from windows, first of all I thought about SQL as well, but it seems oversized for the set of data i want to store. I also took a look at the stackoverflow thread you linked. It looks easy to implement, but the need to use an external class file made me look for another way. I found this one, which works pretty well for me, as I look forward to interchange the method of saving the data with a better one using the SharedPreferences(which actually should be really easy with my code).
Maybe you can tell me yet another thing: Is there a way of declaring an object(like the ArrayList) to make it accessible from every class except from giving every class(activity) it's own "load the preferences" and "save the preferences" code block or sending intents all over the place? This would make saving much easier and allow me to update the preferences during runtime and without a reboot
Edit: This was my answer to.SimplicityApks ^^ I'll take a closer look at SQL now, since you, Jonny, told me that it' nevertheless necessary.
Click to expand...
Click to collapse
Welcome
You mean you want to make your ArrayList, which is an instance variable in the activity, accessible to every other class within your package without having an instance of your activity at hands? Well the basic solution would be to make the ArrayList static. But that is not recommended because it won't be created and garbage collected at the same time as your activity and also it's not a nice way .
If you had an instance of the activity it would be just using a public getter for it, but without I'd put your ArrayList into a separate class following the Singleton pattern. That way you have only one global instance which contains the ArrayList.
Thanks again for your reply! I changed my mind about the ArrayList and created a method, where everything is stored in the SharedPreferences and the ArrayList's only purpose is the use with the ListView and Adapter. This way I don't have to write the ArrayList to the SharedPreferences and changes will be much easier to control. Although I had to implement another type of save/load method to interact with the class thats being loaded by xposed. That was needed because of the restriction that you can only load SharedPreferences with a context, which my class doesn't have. It's an inconvenient way, but it works

Categories

Resources