[Q] taking data from database - Java for Android App Development

I want to create very simple calculation app. For example i want to calculate the winning rates of football teams. There is a formulation and there will be a database file. Let say i create 2 files called database.java and calculation.java. I will enter all the football teams skor database to database.java. What i want is calculation.java should take the data from database.java file.
how can do that? is there any sample like this?

omurcansari said:
I want to create very simple calculation app. For example i want to calculate the winning rates of football teams. There is a formulation and there will be a database file. Let say i create 2 files called database.java and calculation.java. I will enter all the football teams skor database to database.java. What i want is calculation.java should take the data from database.java file.
how can do that? is there any sample like this?
Click to expand...
Click to collapse
Yes there is, but read the doc about storage options first to decide how you want your data to be stored. If it is very simple and small data sets, using SharedPreferences is simple and fast. A text file is quite ugly for this task but will work as well, but if you really have time or will be dealing with large data you'd want to implement an SQL database.

SQL database
accually i have very big database..how can i learn quickly this SQL database thing? Is there any sample you can show me?
many thanks..

http://www.vogella.com/tutorials/AndroidSQLite/article.html
---------------------------------
Phone : Nexus 4
OS :
- KitKat 4.4.4 stock
- Xposed: 58(app_process); 54(bridge)
- SU: SuperSU
- no custom recovery
---------------------------------
4d 61 73 72 65 70 75 73 20 66 74 77
Gesendet von Tapatalk

Related

Auto-Activation of Microphone AGC after Soft-Reset

Hi all!
I searched for a possibility to activate AGC Microphone after a soft-reset automatically.
But I didn't find anything useful.
The key where the ON setting is stored in registry is
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\AdvancedCPL]
If you change MicrophoneAGC from dword 0 to dword 1 it is set to ON but after a soft-reset back to 0.
Does anybody know if it's possible to export this reg-key make a .cab and put this .cab in the Startup-Folder?
I also found this link http://forum.xda-developers.com/viewtopic.php?t=824 but how to use this programm code?
Another possibility is to create a shortcut to the AGC Control and put it in the Start Up-Folder http://forum.xda-developers.com/viewtopic.php?t=8496, but this gives you only the chance to change the setting to ON not to to this complete automatically.
automatic registry edit
Hallo,
you can automatically edit the Registry using mortrunner, a nice freeware tool. After mortrunner is installed create a file with extention ".mortrun" and put it into the startup-folder. Into the ".mortrun" file you write e.g.:
http://www.sto-helit.de/modules/edito/content.php?id=23#registry
RegWriteDWord HKLM,System\CurrentControlSet\AdvancedCPL,MicrophoneAGC,1
good luck
Contractor,
Ah, yes you must be running Microsoft Voice Command. I too ran into this, and found out that some brain-child developer at Microsoft (who works on Voice Command) decided to HARD CODE the setting of HKEY_LOCAL_MACHINE\System\CurrentControlSet\AdvancedCPL\MicrophoneAGC to 0 (false) every time it is run.
Apparently he/she decided this was the best setting for all of us, and to hell with what our personal preferences (you know, that thing in the control panel) were. Unfortunately, as voice command is in the startup, it resets/overrides this setting with every soft reset. IMO, there is a place in hell reserved for this style of development ;-)
I found that Voice Command works a lot better on my Jam with AGC on.
To get around it, I tranferred voicecmd.exe to my desktop, used a hex editor to replace the "HKEY_LOCAL_MACHINE\System\CurrentControlSet\AdvancedCPL\MicrophoneAGC" string in the exe with "HKEY_LOCAL_MACHINE\System\CurrentControlSet\AdvancedCPL\MicrophoneAGP so it wites to the wrong place (not affecting any real settings. I made a backup, and replaced voicecmd.exe on the defice (don't forget to replace the copy in \Windows as well if using the VCABT hack).
Just search for:
4d 00 69 00 63 00 72 00 6f 00 70 00 68 00 6f 00 6e 00 65 00 41 00 47 00 43
and replace with:
4d 00 69 00 63 00 72 00 6f 00 70 00 68 00 6f 00 6e 00 65 00 41 00 47 00 50
Hope this helps, enjoy!
@ orlando:
Thanks for your suggestion.
Mortrunner sounds very good. I will try it and I think I can use it for other settings as well.
@ dschur:
Everything is correct. I use a MDA compact with MS Voice Command and the VCAPT setting.
As a understand you Voice Command sets the AGC to "0" !!!!!!!
Don't they preach to enable AGC to have the best voice recognition???
You are right that Voice Command works much more better with enabled AGC.
Your workaround to override this setting is great. I'll try it and I think that if Voice Command is setting AGC off, orlandos suggestion would only work if mortrunner is loaded in the startup-folder AFTER Voice Command is executed.
P.S.: Voice Command is located on my SD-Card and there is the workaround to start Voice Command as your last application after a soft-reset to ensure that there is no error message.
orlando, dschur: Again - I'm with your help!
@ dschur
Your workaround works perfectly!!!!
Thx.
I'm interested in the workaround to allow Voice Command to be the last loaded app after a soft reset from the SD Card...
I cannot remember how I set this option. Now I start Voice Command in the main memory. But I think the application MemMaid has this option to set the autostart ranking.
Found some screenshots for Memmaid:
http://www.clickapps.com/screenshots.htm?pid=1505&section=PPC
P.S.: Sorry, Autostart is the German translation. Startup Folder is the correct one in English....
For those of us who doesnt know too much about all this, mind making a cab installer that fixes this bug?
Cheers
I'll possibly be making an app to sort this kind of thing out. Eventually. Not too soon unfortunately.
V
montana said:
For those of us who doesnt know too much about all this, mind making a cab installer that fixes this bug?
Cheers
Click to expand...
Click to collapse
I think it's not so easy b'cause it's not like modifing the registry.
You'll have to patch the original MS Voice Command file and post the patched file here?!????
But the other version
(Set the key where the ON setting is stored in registry
([HKEY_LOCAL_MACHINE\System\CurrentControlSet\AdvancedCPL])
in a Sturt-Up folder should be possible.

How to know if connected to GPRS/EDGE or UMTS/HSDPA

Hi all,
Do you know a software which let met know what connection type I'm using between GPRS/EDGE and UMTS/HSDPA ?
The E icon tweak doesn't work on HTC TyTN... Thanks!
It has been posted on this forum that you do not need the tweak as the TyTN will show you the network that you are connected to. I would undo what you have done and check that you are really in UTMS coverage.
... or even try a search for other threads on this :roll:
Really?? So what should be displayed if I'm connected to HSDPA?
'U' I believe. Should say in the manual.
Ok, so this is my point.
I want to know if I'm connected to UMTS or HSDPA.
and the same beetween GPRS and EDGE.
I never saw a "E" on my screen ...
Right you are Taron.
I never saw "E" on my TyTN, though I'm sure I was under EDGE coverage.
I think TyTN just doesn't show clearly what precise kind of network you are connected too.
It just shows "G" if you are under GSM network data coverage (GPRS and EDGE).
It will show "U" if you are under 3G network (UMTS and HSDPA).
what a pity, but thank you for the confirmation
One more question http. Do you have the voicemail icon working fine on your TyTN?
I'm on SFR, and when I have a voicemail, there is no icon neither SMS (even if my voicemail is configured to send a notification)...
Thanks,
just so you know there is a registry hack to show the E instead of G when you are on the edge network. this works seamlessly. i dont know for sure but there is probably a similar registry hack for the same thing with the UMTS/HSDPA connections.
Thanks for the tips, but it was said that this hack doesn't work on TyTN
You can use HSDPA in France ?
Yes, SFR is claiming to provide HSDPA in some regions :
http://www.sfr.fr/info_nouveautes/3G/3Gplus/index.jsp
taron said:
Hi all,
Do you know a software which let met know what connection type I'm using between GPRS/EDGE and UMTS/HSDPA ?
The E icon tweak doesn't work on HTC TyTN... Thanks!
Click to expand...
Click to collapse
I have been trying the same,but in vain.
The reg tweak working for the previous models is not working on the Hermes.
Which brings me to the following question:
Previously with ADDING this new reg key the EDGE differentiation started after rebooting the device.
So some .dll obviously checked for this key, parsed and decoded it and invoked the function in the device.
Question:
How is a (secret) reg key added to the registry parsed ?
Will we find somewhere in a .dll the string "EnableDifferGprsEdgeIcon" (or in the case of the Hermes something else) in real text ?
Can we look for such a value this way ?
Come on all experts here!
I cannot believe that nobody can detail on this here!!!
(P.S. Whenever I try to analyze the ril.dll with a hex editor it just shows zeros. Why ?)
Actually it is not that simple.
First you need a proper ROM dump, with the files intact.
Then you have to know which DLL is responsible for the feature. I don't think it's RIL, it may be device.exe or whatever is showing the taskbar.
Then you need a good decompiler like IDA, which will find the strings.
Keep in mind that all strings on the device are in Unicode so when you look at a string with a hex editor you will see something like this:
65 00 66 00 67 00 68 00
for ABCD
With IDA though you get a special window showing you the list of strings.
there could be difference between what info different operators send to phones connected to their network
so this could explain why ppl expiernce different things connectionwise
help me understand this. i usually just intall 2 cabs on my 8125 after hard reset. one is the GPRS settings for media net and the Edge icon. now that cab only changes my GPRS to icon to E. prob is it dosnt change. now if i install all the extended cab files my connection is ONLY g. that must mean that there is another cab somewhere in there that enables the switch. idk someone help
this sucks. i cant even tell if i have Edge or not.
levenum said:
Actually it is not that simple.
First you need a proper ROM dump, with the files intact.
Then you have to know which DLL is responsible for the feature. I don't think it's RIL, it may be device.exe or whatever is showing the taskbar.
Then you need a good decompiler like IDA, which will find the strings.
Keep in mind that all strings on the device are in Unicode so when you look at a string with a hex editor you will see something like this:
65 00 66 00 67 00 68 00
for ABCD
With IDA though you get a special window showing you the list of strings.
Click to expand...
Click to collapse
Hi levenum,
you mean a dump of all files which can be seen in a file explorer (e.g. Resco) but cannot be read, as they are marked ROM or hidden or system, don't you ?
Well there seems to be a tool for extracting such files on buzzdev, called "WM5 Files Dumper".
Unfortunately it won't work with my TyTN as it tries to write the files on to a predefied directory on "Storage Card". Unfortunately in the German version the Storage Card location is called Speicherkarte.
I do not know if it is safe to change this temporarily to Storage Card without destroying all other links and no longer be able to access or start the programs installed on the storage card.
Maybe someone could fix that rather in the "WM5 Files Dumper" where the output directory is hard-coded.
What a painful restriction ! I can imagine that this utility would be valuable for many of us trying to find out more about their devices...
I know that most of the strings are encoded in Unicode.
The Cygnus HexEditor is able to look for Unicode strings, so this wouldn't be the problem.
levenum said:
Actually it is not that simple.
First you need a proper ROM dump, with the files intact.
Then you have to know which DLL is responsible for the feature. I don't think it's RIL, it may be device.exe or whatever is showing the taskbar.
Then you need a good decompiler like IDA, which will find the strings.
Keep in mind that all strings on the device are in Unicode so when you look at a string with a hex editor you will see something like this:
65 00 66 00 67 00 68 00
for ABCD
With IDA though you get a special window showing you the list of strings.
Click to expand...
Click to collapse
Hi levenum,
you mean a dump of all files which can be seen in a file explorer (e.g. Resco) but cannot be read, as they are marked ROM or hidden or system, don't you ?
Well there seems to be a tool for extracting such files on buzzdev, called "WM5 Files Dumper".
Unfortunately it won't work with my TyTN as it tries to write the files on to a predefied directory on "Storage Card". Unfortunately in the German version the Storage Card location is called Speicherkarte.
I do not know if it is safe to change this temporarily to Storage Card without destroying all other links and no longer be able to access or start the programs installed on the storage card.
Maybe someone could fix that rather in the "WM5 Files Dumper" where the output directory is hard-coded.
What a painful restriction ! I can imagine that this utility would be valuable for many of us trying to find out more about their devices...
I know that most of the strings are encoded in Unicode.
The Cygnus HexEditor is able to look for Unicode strings, so this wouldn't be the problem.
well for t-mobile at least, when your on 3g you are on HSDPA, where ever there is UMTS signal there is HSDPA signal (i asked the question to t-mob cs)

How can I change the PagePool Size to 0mb

I want to try that and I can find the HEX code for 12mb as [03 15 A0 03 00 10 8E 05 03 00 00 0A],but I dont know what can I do to 0mb……anyone can help me?thanks
on the artemis tom codon came up with 'change pool size' app (6,8,10,12 i think) but i don't think there's one for polaris - don't try that app for polaris, it won't work, just saying in principle.
i'm no expert at all here and i may get this the wrong way round but...
larger page pool = faster system operation (but less allocated memory for applications ie. 2 or 3 larger apps running at once may struggle)
smaller page pool = emphasis on launching and running programs/applications (but slower system overall)
so i'm guessing (and it is a guess) that a zero page pool isn't possible because this would make the system unusable (you can vary the scale of memory allocation but not loose one side all together), say it's a volume control - you've 0 - 30 in sound but you're only allowed to change between 8 - 24, the others are off limits.
wanted to change my page pool on polaris roms like with tom's app, read a bit about it, pm'd tom for guidance but got no response - probably because all the info is already out there somewhere, just gotta dig and read.
good luck though
(also my memory's **** so as i said before, i could have the above the wrong way round, there's a few posts about though)
You can use OmBy's pagepool changer:
http://forum.xda-developers.com/showthread.php?t=323269
But you can not change the pagepool "on the fly". That means you have to extract the rom file, change the pagepool and flash it.
And I would not change the PP to 0

[Q] How to Modify BattDrvr.dll (So as to remove FlashLightPowerUnavailable)??

I have been searching for quite a while (~2 weeks) & have not been able to find anything that helps me do what I want. I have been working on a modified HD2 ROM for my TMOUS HD2 {based on 2.13 ROM}. I have made many changes & have been able to apply most all the mods that interest me the most. There are many references to my problem; but no permanent fixes, & I am tired of the the tempory fix.
The tweak that has eluded me is the "FlashPowerUnavailable" registry entry. I have traced everything within the ROM & could not find the registry setup for this feature. After an extensive search thru all the .DLLs, I was finally able to find the settings. They are located in Battdrvr.dll. From what I understand; the .DLL reads the battery level & automatically inserts a registry key that disables the camera's flash whenever the battery level reaches 20% or less. Even if you delete the registry entry, the .DLL will reinsert it as soon as the battery goes below 20%. Personally I am tired of having to edit the registry everytime I want to take a pic when the battery level is low. The flash adds no real power drain & therefore the "FlashLightPowerUnavailable" is a BS setting that is completely unneeded.
So, here is my question to the community. Is there anyone that can rewrite the HD2's Battdrvr.dll so as to remove any reference to the "FlashLightPowerUnavailable" registry? If it's not possible to remove it completely; is there a way to change the trigger from 20% to 1%?
With the exception of changing graphics & text; I will not even pretend to know what I am doing when it comes to modifying a .DLL file. As such, I have not even attempted to modify this .dll. I have PEexplorer, Restorator, & ResHack on my machine, but I only use them for editing graphics & icons {& occasionally text}. If someone could modify the .dll, I would be extremely grateful. Of course; I'm sure that I am not the only one that would like to have this mod done. Of course; I am also willing to try & learn if someone would want to walk me thru modifying a .dll file.
I have attached BattDrvr.dll in the below .7z file. The zipped folder contains the original module {pulled from 2.13.531.1}, as well as the actual .dll itself. Any help is greatly appreciated.
Thanx:
Hippie
I'm not too familiar with Battery drivers but if you could find a way to have it be associated with Power Saving Mode you could just have power saver kick in at %1..?
But like I said I have no idea how it works..
Sorry for the delayed responce.
BattDrvr adds a registry entry when the battery reaches 20%. It is also readded to the registry upon every reboot. One would need to create an event to monitor the status of the reg entry, & delete/change it when it is activated. Personally; I am not real familiar with the event system & have not dealt with it too much {except to deactivate events thru DotFreds task mngr}.
Would creating an event utilize any system resources? I am trying to do this without adding another footprint to the system {no matter how small}. I know that modding the .Dll will accomplish what I want without creating any new footprints. This is why I posted this question to the community to begin with.
Personally I can't believe that this hasn't been done already. I also can't believe that there seems to be no interest in this whatsoever. I can't be the only one that uses the flash after the battery is below 20%.
I didn't test it, don't have device
What i did was:
Open hex editor, Search for "00 53 E3 35 00 00 9A 1C 37 91 E5 02 00 53 E3" the number before that found should be "14" (which is "20" in decimal) change to "01" (which is "1" in decimal).
I used IDA and HxD
The modded file is in attachment
Vico100 said:
I didn't test it, don't have device
What i did was:
Open hex editor, Search for "00 53 E3 35 00 00 9A 1C 37 91 E5 02 00 53 E3" the number before that found should be "14" (which is "20" in decimal) change to "01" (which is "1" in decimal).
I used IDA and HxD
The modded file is in attachment
Click to expand...
Click to collapse
Little Off topic .. but you seem to know howto hex edit stuff
Been woundering why no one has hexed skyfire so it doesnt check for the skyfire server .. and just goes to google or so other website ..
I was able to get SkyFire working today kinda .. by "tricking" it and made it goto google .. after that .. I was able to surf NP ..
Just a thought
hmmm..i don't know about android...never tried.
Vico100 said:
hmmm..i don't know about android...never tried.
Click to expand...
Click to collapse
No No .. Skyfire is also for WM
Vico100 said:
I didn't test it, don't have device
What i did was:
Open hex editor, Search for "00 53 E3 35 00 00 9A 1C 37 91 E5 02 00 53 E3" the number before that found should be "14" (which is "20" in decimal) change to "01" (which is "1" in decimal).
I used IDA and HxD
The modded file is in attachment
Click to expand...
Click to collapse
Glad I found this. Will try it out when TMOUS sends me my two free HD2s. Thanks. If anyone can report back as to weather it works or not, please do. Might take me a while since mine are on backorder.

(Q) Windows phone 7 secrets by Paul Thurrott

I managed to get hold of a book on Amazon called Windows phone 7 secrets by Paul Thurrott. I was just interested to see if anyone else has read it? I found it to be a good read and it has taught me quite a few things about WP7 that i didn't know. Best of all it tells you why Windows phones are MILES better than the Iphone 4!! You should all have a read if your into WP7. Its a good book (and i usually don't read books)
adamlayzell69 said:
I managed to get hold of a book on Amazon called Windows phone 7 secrets by Paul Thurrott. I was just interested to see if anyone else has read it? I found it to be a good read and it has taught me quite a few things about WP7 that i didn't know. Best of all it tells you why Windows phones are MILES better than the Iphone 4!! You should all have a read if your into WP7. Its a good book (and i usually don't read books)
Click to expand...
Click to collapse
Could you please make a summary of that book?
Most of us know why it's going to be equal or better from android and iOS, it's because of the tools the sdk the programming language and the ease of converting or modifying existing windows applications to run on wp7 with little effort, plus the fact that there are tons of developers that they already know the programming language.
Contents.
telas said:
Could you please make a summary of that book?
Most of us know why it's going to be equal or better from android and iOS, it's because of the tools the sdk the programming language and the ease of converting or modifying existing windows applications to run on wp7 with little effort, plus the fact that there are tons of developers that they already know the programming language.
Click to expand...
Click to collapse
Here are a summary of the contents if it helps??!
Contents
Introduction xvii
Chapter 1 3 Pre-Flight Checklist: What to Do Before You Get Your
Windows Phone.
Windows Live ID: One Online ID to Rule Them All 2
Using Windows Live ID to Access Your Social
Networks and Other Services 11
Picking a Phone 25
Summary 32
Chapter 2 3 Unboxing and Getting Started 33
Unboxing Your Windows Phone 34
Windows Phone Usage 52
Summary 64
Chapter 3 3 Understanding the Windows Phone User Interface 65
The Way We Were: How Microsoft Screwed Up
Mobile So Bad It Had to Start Over from Scratch 66
A New Beginning: Metro 69
Real-World Metro: A Whirlwind Tour of the UI 82
Hubs and Applications 86
Summary 100
Chapter 4 3 You and Your Friends: How to Connect with Others,
Connect to the World103
Managing Your Digital Persona 104
Being a People Person: Managing Your Family,
Friends, and Other Contacts 108
Configuring the People Hub 120
xiv Contents
Chapter 5 3 Digital Memories: Using the Pictures Hub and Camera123
Using the Pictures Hub 124
Taking Pictures and Videos with the Camera 127
Moving Photos Between the Phone and Your PC 136
Sharing Photos and Customizing Your Phone 143
Configuring Pictures Hub Options 148
Summary 149
Chapter 6 3 Zune to Go: Music + Videos 151
Using the Zune PC Software with Windows Phone 152
Enjoying Music and Video Content on Windows Phone 165
Why Zune Is Different 182
More Music: Pandora and Other Services 186
Summary 187
Chapter 7 3 Having Fun: Windows Phone and Games 189
Windows Phone: Great Mobile Gaming Platform 190
Understanding Xbox Live 194
Xbox Live on Windows Phone: Not the Full Meal Deal 200
Using the Games Hub 202
Playing a Game 206
Finding More Games in the Marketplace 207
Summary 209
Chapter 8 3 Browsing the Web 211
A (Short) History of the Mobile Web 212
Using Internet Explorer on Windows Phone 214
Configuring Internet Explorer 232
Summary 235
Chapter 9 3 Searching on the Go with Bing 237
Bing: A Different Way to Search 238
Using Bing 244
Configuring Bing 265
Summary 265
Contents xv
Chapter 10 3 Managing E‑mail on the Go 267
Push It: A Look at Mobile E‑mail 268
Understanding Accounts and E‑mail 269
Using Mail 273
Configuring Mail and E‑mail Accounts 292
Summary 294
Chapter 11 3 Tracking Your Schedule with Calendar 295
Connected Calendars 296
Glancing at Your Schedule on the Go 303
Using Calendar 305
Working with Appointments and Reminders 309
Configuring Calendar 315
Summary 316
Chapter 12 3 Getting Work Done on the Go with Office Mobile 317
Introducing the Tiniest Member of the Office Family 318
What You Can—and Can’t Do—with Office Mobile 320
Using the Office Hub 322
Accessing Online Documents 341
Configuring Office Mobile 351
Summary 352
Chapter 13 3 Making Calls and Using Voicemail 353
Configuring Contacts Accounts 354
Making and Receiving Phone Calls 355
Using Voicemail 367
Working with Bluetooth 368
Configuring Phone and Voicemail 370
Summary 375
Chapter 14 3 Text and Multimedia Messaging 377
Understanding Mobile Messaging 378
Messaging on Windows Phone 380
xvi Contents
Configuring Messaging 389
Beyond Messaging 390
Summary 391
Chapter 15 3 Digging Deeper into Phone Configuration 393
Configuring What Happens When the Phone Is Locked 394
Configuring Sounds 397
Using Windows Phone on an Airplane 399
Configuring Accounts 400
Making Region and Language Configuration Changes 404
Wi-Fi Sync 405
Nuke It from Space and Start Over 407
Summary 409
Chapter 16 3 PC and Web Integration 411
You Can’t Get There from Here 412
Browsing and Buying in the Marketplace 412
Windows Phone on the Web 420
Updating Windows Phone 430
Summary 431
Index 433
400+ pages on the WP7
im impressed, think i might take a gander i sure as hell couldnt write 400+ pages on it so there must be something i dont know about it in there!
Cheers
...Damn...
There's a lot of reading there!
If you go to Google Books http://books.google.co.uk/books?id=...s by Paul Thurrott&pg=PP1#v=onepage&q&f=false you can view it there. There are a couple of pages missing though.
http://windowsphonesecrets.com/
neilarmes said:
If you go to Google Books http://books.google.co.uk/books?id=...s by Paul Thurrott&pg=PP1#v=onepage&q&f=false you can view it there. There are a couple of pages missing though.
Click to expand...
Click to collapse
I did have a look but there is over half the book missing.

Categories

Resources