CardsLib implementation question - Java for Android App Development

Hello guys,
These days I've figured it out that my app would look better using some google now-like cards. I've implemented cardsLib and created some layouts for every card I'd need. Everything is working fine except that i can't update their content at onCreate, onStart or onResume and I really need to get some data, interpret it and then populate those Cards wich contains some edit texts.
If I place a button and then try to set some texts works, but i'd need this to be automatically.
I have tried inflating the layout which contains the edit texts, but it just leaves them blank.
Any idea or workaround would be greatly appreciated.
Thank you!
Sent from my Nexus 5 using XDA Free mobile app

Related

SMSHelper

My officemate made this application after we found out that it is almost impossible to send an SMS message while driving or walking. Since we were used to the cellular phone style of messaging, SMSHelper was made.
Copy the SMSHelper.exe to you \Windows\Start Menu and the SMSSettings.cfg to your \Windows directory.
When you first launch the application, go to File > Settings and set your country code and message type to Class 1. You can also enter a default recipient if you have a contact you often send to.
This is the first version so be please post any problems you encounter, have fun SMSing
thanks man.. will give it a try
Great Job so far, but a couple of problems so far:
Major: Everytime I send a message it fails "Message Failed! Network error (tried entering the number myself and it worked - so its a problem when sending from contacts).
Took awhile to find out how to space, might be nice to have a space button near the backspace.
Thanks, I have been waiting for a simple\easy SMS program.
Application is good, but I have 2 suggestions:
1. I have recorded contacts in my address book by using +48, but your application recognizes only 48 without +. In consequence, message sent by using contacts, is fails.
2. There will be better idea if your application is one of some kind of keyboard, user can chose from keyboard list. Then, message you sent will be record in sent items.
Greeting,
Yazzon
Ayos!
Great job bro!
So far so good. For my suggestions, I agree with Yazzon's.
1. Include this application as one of input options (e.g. keyboard, transcriber, etc..). i think it would require hacking of somekind, i dont really know, but I know you can do it, or your officemate can.
2. SMS should be saved in Sent Items folder after sending.
3. And most important of all, perhaps you could add a character counter somewhere.
Overall, its a great application. Bravo! Magaling talaga tayong mga Pinoys, naks, hehehe
Can I have one in Arabic version as the following...:
"0"
Space
"1"
Signs
"abc"
1:0x062f
2:0x0630
3:0x0631
4:0x0632
"def"
1:0x062c
2:0x062d
3:0x062e
"ghi"
1:0x0628
2:0x062a
3:0x0629
4:0x062b
"jkl"
1:0x0627
2:0x0623
3:0x0625
4:0x0622
5:0x0626
6:0x0624
7:0x0621
"mno"
1:0x0646
2:0x0647
3:0x0648
4:0x064a
5:0x0649
"pqrs"
1:0x0641
2:0x0642
3:0x0643
4:0x0644
5:0x0645
"tuv"
1:0x0637
2:0x0638
3:0x0639
4:0x063a
"wxyz"
1:0x0633
2:0x0634
3:0x0635
4:0x0636
Best regards,,,
...and another thing. Maybe you could change the character sequence of button 1, i think the appropriate first character should be "." period. And perhaps you could also add a feature like "Insert Number", it somehow comes handy at times. Thanks.
thanks for your feedback, i'll pass them to my officemate.
the contacts format works like this, if you use '0'+areacode+number to store your contacts, it omits the '0' and replaces it with a '+xxx' with xxx being the country code you enter in the settings.
if you already use a '+xxx' format, the application sends the message immediately. just make sure that you set your country code in the settings or your messages will fail because the default is +63.
the messages does not appear in the sent items because it does not use the POOM or Pocket Outlook.
this is just an alpha release major improvements will be added on the succeeding realeases.
Suggestion...
I think its good if the application makes a sound when a key is pressed. Also, close app button should be removed. Sent items and outbox support + reply directly to smshelper.
Im willing to help in the development is you are willing to share the codes.
~ishtangli
ishtangli said:
Suggestion...
I think its good if the application makes a sound when a key is pressed. Also, close app button should be removed. Sent items and outbox support + reply directly to smshelper.
Im willing to help in the development is you are willing to share the codes.
~ishtangli
Click to expand...
Click to collapse
Your other suggestions are good but a close button is the one thing missing in most PPC apps.
Forgot that im using SPB Pocket Plus...
~ishtangli

[Q] Question about automated reply function

Hi guys. Developing an app with a simple enough concept. I want to be able to launch an app that has a textbox that a custom string can be saved to. When an sms message is received, the string is sent back automatically as a reply. So far I have an EditText in the xml and set up shared preferences so the string stays persistent if you exit back to the apps "main menu".
I have seen alot of sample code online but am struggling to get a decent example of my specific requirement that I could implement to what I already have in place.
Can anyone advise on how I could do this with the most ease?
I have researched smsmessagingdemo.java online and it's not really what I need.
And the "simple concept" is always a "killer" for programmers as they usually end up being hard to implement! LOL Such is the case here.
The app idea is a good one; kind of like your own personal "call waiting" app for texts.
just fyi
There's already a few apps on the market that do something like this. Otterbox is one example: https://market.android.com/details?id=com.otterapp.otter I think state farm has an app that does similar.

Requesting Help: Would like to add and "Add Account" Option on List View..

Requesting Help for an Application I am modifying., There is a very simple Password Manager called UPM, and basically I have been modifying it's base code to have additional features. The original Code is located at "github.com/adrian/upm-android", and the modified code I am working on is at "github.com/servingbaby/UPM-Epassafe".
So far I have been successful in implementing most of the changes I have planned for. I'm currently stuck though with one change I would like to put in. In the Listview, when long press on one of the items, I currently have the choice to edit that particular item. I would like to add the option to also delete that current item.
I have attempted different avenues of implementing the code that would do this, however I keep coming up short as the best way to get this to work.
I would really appreciate some help in solving this issue.
The particular files I have been looking at are, AccountsList.java, AddEditAccount.java, FullAccountList.java, ViewAccountDetails.java, and account_context_menu.xml.
Thankyou for any advice!
In the onlongclicklistener method you should inflate a contextmenu. You can add options in an xml file or programatically ( http://developer.android.com/guide/topics/ui/menus.html).
Sent from my NexusHD2 using xda app-developers app
Thank you for your advice. I've pretty much modified the program in so many areas. Almost like a different program now. Ended up changing a lot of features and adding some. There's only one more thing left for me to do before I declare beta over and that is to get a delete account option from the context menu from List View. It's been the one thing I've had the hardest time with.

[Q] ListView with huge data from backend-server

Hi,
What's the best approach to load a listview contents from a backend-server (internet)? I mean, I want to populate on-the-go a listview that will retrieve data from a internet server. For example, I want to know all orders from my e-commerce from my app, and I have like 5000 orders in the last week, I won't load this 5000 orders because my app will have a great load time and memory consumation.
My idea is load more when user get close to the last element of list, but I don't know how to do this, and about memory consumation? Is better to continue with the data in memory (when user goes back to upper), or save it on a file-cache (better than memory?) and load when user scroll back to the top?
Thanks,
While the user is the activity you must hold each of the list item in memory anything other than that will cause serious lag in your app
While at other times you may cache them to save resources
Sent from my GT-S5302 using Tapatalk 2
You definetely need ASyncTask here. You can define a class as asynctask, which lets you implement a few methods to use as a background thread. So whenever you wan to load more items you can call this background thread which does not block the UI.
Also, if I remember correctly, you can implement a method which lets you know which list item is at the top of the screen, the total number of items in the listview, and the number of items on the screen.So with this method you can find out whrn you reached the last item in the listview.
I hope this helped a little, at least you got some stuff to google
Sent from my NexusHD2 using xda app-developers app
Ya as he said use a global variable and update it in getView if adapter hence ull know the last loaded view
Sent from my GT-S5302 using Tapatalk 2

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