Search Database From A Web Server - Java for Android App Development

I want my app to have a search function but instead of searching locally, I want to search from the data on my web server and return the data in a JSON format. The good thing is, I know how to do this but I'm not sure how can I implement an activity with this kind of interface and behavior.
Legends are as follow: (Please see the mockup image that I attached below)
Black - Action Bar
Blue - Activity Container
Red - Searching (Search input and button here)
Green - List View (Fetched data from the web server)
Basically I want the user to input their search key and when they press the search button, a loading image will appear while the data are being fetched, when the fetching is completed I want the fetched data to appear on the list view on the same activity.
Thank you and have a good day!

clonedaccnt said:
I want my app to have a search function but instead of searching locally, I want to search from the data on my web server and return the data in a JSON format. The good thing is, I know how to do this but I'm not sure how can I implement an activity with this kind of interface and behavior.
Legends are as follow: (Please see the mockup image that I attached below)
Black - Action Bar
Blue - Activity Container
Red - Searching (Search input and button here)
Green - List View (Fetched data from the web server)
Basically I want the user to input their search key and when they press the search button, a loading image will appear while the data are being fetched, when the fetching is completed I want the fetched data to appear on the list view on the same activity.
Thank you and have a good day!
Click to expand...
Click to collapse
Your red searching layout can either be done manually using a horizontal LinearLayout with an ImageButton and an EditText, or, in my view far easier, with a SearchView in the ActionBar. Head over to this documentation page to set it up! You'll then get a call to onNewIntent with the search query and use that to update your ListView from the server.

Related

How do I change O2 Internet Explorer default from O2's site?

I can't seem to figure out how to change that button left of space bar so that it launches IE to my home page (Google).
Everytime I click it, it goes to O2's pda site.
Any tips?
Thx.
It'll be in the registry, can't be arsed to look now
But if you copy the \windows\default.htm file (the web page you see when you open PIE every time) to your PC, you can open it up in Notepad and put a link to Google - meaning you can just click on the link on the page instead of click on the home page button whenever you want to go to Google.
The right HTML for that is
Go to Google
Just put that in anywhere (so long as it's inbetween the <body> and </body> tags, easiest way is to just paste that code in right before the </body> tag, which will put the link at the bottom of the page anyway.
That's one quick-and-dirty way of hacking the web page to show a link to Google - once you've done that and saved the modified page on your PC, just replace the html file on your PC with the copy in the \windows directory on your XDA.
Job's a good un!
AboutURLs
Look for the dword 'home' with value 'file://\Windows\default.htm' in key AboutURLs
Cheers, M
Look at the wiki. It's exlpained in there.
To save you the trouble: Go to HKEY_LOCAL_MACHINE\HARDWARE\OEM\KEYBD and change the key to whatever you want.
Thanks for following up with more definitive answers guys (I actually like hacking the O2 start page, call me weird) - I just didn't have the mental capacity to go sifting through the registry once more at 5am on a Thursday morning.

Webpage as Today Backgound

This is just an idea.. but I think it would be nice to be able to setup the background of the Today Screen to a web page.
possible uses are:
1) webcams image pages that are updated every minute
2) traffic pages that are updated every minute etc.
3) other type web mini dashboards
etc.
possible options are
1) reload every xmin
2) reload olny when there is a open data connection
3) reload schedule
3) green icon in bottom left if last refreshed < 1min
etc
questsin said:
This is just an idea.. but I think it would be nice to be able to setup the background of the Today Screen to a web page.
possible uses are:
1) webcams image pages that are updated every minute
2) traffic pages that are updated every minute etc.
3) other type web mini dashboards
etc.
possible options are
1) reload every xmin
2) reload olny when there is a open data connection
3) reload schedule
3) green icon in bottom left if last refreshed < 1min
etc
Click to expand...
Click to collapse
Tap/hold/save image(pop up) on the webpage, find saved image,tap on file, tap menu, tap set as today background. For the best background image should be set at "0", click OK(on top), this can also be done going to IE5 temporary internet files and following the same above procedures.
hotdog53 said:
Tap/hold/save image(pop up) on the webpage, find saved image,tap on file, tap menu, tap set as today background. For the best background image should be set at "0", click OK(on top), this can also be done going to IE5 temporary internet files and following the same above procedures.
Click to expand...
Click to collapse
To have the whole webpage as tbg, capture the page using a screen capture utility, find the capture in file explorer, tap, menu, set as today background.
hotdog53 said:
To have the whole webpage as tbg, capture the page using a screen capture utility, find the capture in file explorer, tap, menu, set as today background.
Click to expand...
Click to collapse
As an example, I'm using this webpage (1) as a today background. Pict. 2 is the page that comes up after "set as today background" from menu at bottom right.
I dont think he wants a screen shot of the webpage.
Im guessing he wants an active webpage as the background, much like the windows active desktop thing. Its a great idea and i would personally use this.
an active desktop kinda thingy is not present for windows mobile, but i guess there can be a "workaround'. e.g., a program can pull an image from a server every x seconds and change ur background with it.
Sometime down the line (if this has not already been done by then) I might include this in my timed wallpaper/theme cycler proggie..
if you follow the instructions from ms on using the compact framework to create a today item you will end up with a web page item. It would then be a more simple task to load content from the internet. I know it can work because i did it a while ago. I got as far as using html to set the window colour then went back to purely native today items.
Warning: it is a major pain in the back side to do that project. It involves a managed side and a native side that work together.
Id like an active webpage, but an active image from a web site refreshed on an interval would be nice
questsin said:
Id like an active webpage, but an active image from a web site refreshed on an interval would be nice
Click to expand...
Click to collapse
Try here:
www.kickingdesigns.com

Try this! (more stuff added)

Ok, by now you probably know HTC's nice text selection tool. To use it, write some words in a HTC application (like the text message composer), then tap-and-hold somewhere in the text. You get one handle to move around, or two if you want to select a precise part.
But there's more. Change "HKLM/Software/HTC/TextSelection/EnableMagnifier" from 0 to 1. Now activate the text selection tool again as described above and try moving the single handle around...
Nice catch. Can be helpful in tight selections. I've been looking through the reg. So much stuff disabled... Why does HTC do this? They could've placed it as an option on SMS menu...
Thanks. Added to tips thread.
Maybe they disable it so we at XDA have something to do until HSPL is released
Some other simple but cool things I discovered:
* You can use the album app to crop pictures. Just pinch-to-zoom until the part you want fills the screen, then tap the screen, tap the icon on the bottom right and choose the second option from the menu. In Dutch it's called 'Schermafbeelding opslaan'. It will save a cropped copy of your pic.
* Here's a registry entry I found: "HKLM/Software/HTC/Manila/InternetPush/EnablePushInternet". It's set to 0 by default. I'm not really interested in push internet, so I haven't experimented with this, but it seems you can enable it if you want.
* Sometimes touch scrolling gets in the way of selecting text. If you want to select text, the solution depends on the context, but to start you just tap-and-hold anywhere:
-- In Opera, you can switch text selection on/off in the context menu;
-- In some apps (like while reading an e-mail message) you get a pop-up menu where the first option is 'make selection' ('selectie maken' on my Dutch device);
-- In Word, just before the pop-up menu appears, you see this: '[T]'. As soon as it appears, move your finger and you'll be able to select text!
* If you like the Footprints app but prefer full size pictures to those square 'polaroids', there's an option to save a full sized copy whenever you create a 'Footprint' (Footprints tab -> Menu -> Settings).
* The 'me' entry in the People app stores your 'owner' info. I know this is widely known by now, partly because I've been posting it everywhere, but I still see so many people complaining they can't register their applications (Resco stuff, SKtools)... because the can't find the old owner info icon. I have registered both Resco Explorer and SKtools perfectly fine without ever bringing the owner info icon back.
I haven't ever been able to get the Text Selection sliders to work on a custom rom even after setting the registry value to 1.
This is an awesome feature and I can't understand why it doesn't work.
leepriestenator said:
I haven't ever been able to get the Text Selection sliders to work on a custom rom even after setting the registry value to 1.
This is an awesome feature and I can't understand why it doesn't work.
Click to expand...
Click to collapse
you know it only works in text messaging, right? (well, some other htc apps too, apparently, but i couldn't name another one i've seen it in)
Yes of course... I'm aware that it only works in the realm of Sense specifically mail and text. I can do the standard selection thing but I just can't seem to get the sliders.
Any ideas?
hmm, well a common mistake I've come across a few times is people not pressing select the first time.
firstly go type some text into a new text message. (not sure where the idea it works in email came from, certainly doesn't on mine.)
ok, press and hold should bring up a cursor and the words "select|select all.
use the single sljder to set the start(or end, whichever) press 'select' nd now a second slider should join the first, enabling you to select.
Thanks for the responses guys, but as it turned out, I didn't realise that Energy ROMs are stripped of the HTC Messaging Module and that seems to be the only place where this 'feature' works.
It's a shame that's it's not available system-wide considering how easy it makes life.
I installed the HTC Messaging Client and voila, it was it there! but that excitement was short lived considering how bad HTC's messaging client is.
hah couldn't agree more. with the magnifier too its great ,, just never gets used.

[WebTop]-[How To] Create shortcuts to custom phone actions on Webtop

I looked around and couldn't find a detailed guide on how to do this so I figured it out and decided to share..
Prerequisites:
Working Webtop
XFCE Desktop
or
AWN Manager
aLogcat > https://market.android.com/details?id=org.jtb.alogcat&hl=en
This is a simple proccess which will require you to use aLogcat to get the activity name of the item you want to launch and then simply make a new shortcut item on your launcher.
Getting our activity name:
Launch aLogcat
Hit the menu button on your phone
Select Filter
type "activityMan"
leave the option for regular expression unchecked
--Now that your application is logging and filtered you will see a window with alot of text. This is where we will be searching.
hit your menu button again
Select Clear
Now hit your home button and navigate to the icon you would like to be able to directly launch from your webtop and click it.
Go back to aLogcat
Hit the menu button on your phone.
Choose the pause option from ALogcat
***Now were going to search for the string we need to tell activity manager which activity to launch**
Look through your log for something that looks like this: "com.p1.chompsms/.activities.ConversationList" (this one will launch ChompSMS)
In my case the entire line looked like this: /ActivityManager( 1700): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.p1.chompsms/.activities.MainActivity bnds=[5,343][115,483] } from pid 3088
copy the string that comes after "cmp=" (bolded above)
Creating the shortcut
Depending on which interface you are using this will differ slightly:
For AWN Manager
Open AWN Manager
Choose Launchers
Click Add
Set your name description and Icon
For Command add the following: androidlauncher --action "android.intent.action.MAIN" --cmp "<TEXT THAT YOU COPIED ABOVE>"
For XFCE
Right click on the task bar.
Choose "Customize Panels"
Next to where it says Panel 1 hit the + button to create a new Panel.
**Select the new panel and edit its options**
Set it to Normal Width | Fixed position | And then select the position where you would like to see it on your screen.
Change icon size to suit your taste. (Tip, if you would like to use the icon for the application an easy way to get it is to Google "AppName icon" and then use Google's image search. Choose an icon that's somewhere near 96*96 (you can sort by size), save it and select it from the menu.
Now that we have created a shortcut / panel
Right click the new panel / Icon
Add new Items
Launcher
Set your name description and Icon
For Command add the following: androidlauncher --action "android.intent.action.MAIN" --cmp "<TEXT THAT YOU COPIED ABOVE>"
you now have a working shortcut that will pull up the app or activity in "Mobile view" on your webtop!
Yay.
If anyone knows any more tricks with this please let me know! I have been wondering if it is possible to tell the app to come up in full screen.
** if this helped you please remember to hit the thanks button (help a guy boost his newb cred) **
Thanks for this. You probably saved me a lot of time because I was going to try to figure out how to do this.
Have all the apps on the phone worked without problems?
Also, does the Entertainment App work thru XFCE Desktop without the Awn dock?
blingmaster said:
Thanks for this. You probably saved me a lot of time because I was going to try to figure out how to do this.
Have all the apps on the phone worked without problems?
Also, does the Entertainment App work thru XFCE Desktop without the Awn dock?
Click to expand...
Click to collapse
I haven't tested enough to say whether everything works or not. I also haven't eve used the entertainment center . This was one of the primary reasons why I was frustrated with the original webtop. They gave use the ability to launch only a couple of their apps rather than just creating a mechanism for us to select apps for shortcuts. This is something I may look into developing in the future.
Awesome work! I was just going to look at this today after looking at XFCE menu editing yesterday and BAM you already did it!
Too bad I broke my webtop somehow and had to start over this morning. I'm getting so practiced I could do it in my sleep!
Upon further thinking, you could probably just create a .desktop file like the other ones have and then it would automagically get put in the XFCE menu. Then it could be scripted and added into webtopscripts or something.
stewartsoda said:
Awesome work! I was just going to look at this today after looking at XFCE menu editing yesterday and BAM you already did it!
Too bad I broke my webtop somehow and had to start over this morning. I'm getting so practiced I could do it in my sleep!
Upon further thinking, you could probably just create a .desktop file like the other ones have and then it would automagically get put in the XFCE menu. Then it could be scripted and added into webtopscripts or something.
Click to expand...
Click to collapse
Last night was my first night with a working webtop, being able to quickly launch ChompSMS , or pandora on my mobile view was top priority for me. Now that I have that mostly handled I guess I need to move on to learning XFCE tweaks. I'm really glad this helped, I was really surprised that this wasn't already hashed out and detailed, but I was glad to finally be able to contribute something over here!
Hi nineismine,
Mind to provide me a little bit of extra info on the below? Thank you in advance.
(1) How to "remove" the pre-installed short-cut apps in mobile view? For example the "Messaging". I rather prefer to replace this with the "Text Messaging" by following your tutorial.
(2) How to "remove" the pre-installed short-cut apps in webtop view? For example, mine Atrix is Asia Retail version and it build-in with the "Motorola Video" app-tray which I have no idea how to "remove" it.
I herewith attached the screenshot on my stock webtop for your reference (the stock webtop do support screenshot feature and I learn this from this link: http://forum.xda-developers.com/showpost.php?p=17093665&postcount=3)
Edited:
I found my solution by installing the webtop2SD. My issue solved. Thanks.

[TIP] For Opera Mobile users enable Desktop UA but keep getting Google mobile

So I've searched around a bit but I never found an answer to my problem - all my websites were coming up as the Desktop version except for my Google searches which kept being displayed in the awful mobile version.
Then it hit me - it's just that the search engine shortcut bar on Opera's top right is configured to search the mobile Google site.
In order to change this:
1. click on the drop-down arrow in the search bar
2. manage search engines
3. hold down on any search engine other than Google (Opera developers have made this entry unchangeable.)
4. Edit - change the Title to "Google" or whatever else you'd prefer AND change the address to " http://www.google.com/search?q=" without the quotes.
5. Save
You will now have a more complete Desktop browsing experience.
Hope this helps

Categories

Resources