yashsingh1/xdaforums huggingface dataset:
[Windows 8 Development and Hacking] Beatsleigher:
Hello guys,

Today I'm going to provide an easy and step-by-step guide (With support) to develop your very own first native Windows app!

I'll also provide screenshots and code snippets, so it's easier to understand.

This guide and app will be written in the simplest language I know and I use, Microsoft Visual Basic. Now, before anyone starts hating; Visual Basic is a programming language which works with and on top of the .Net framework. As the name states, you can visually design your application and code it with very basic code.

Visual Basic is also very powerful, as it can be used to communicate with the Windows OS and with the computer's hardware (And especially COM ports)

This guide will focus on the use of the WinForms (Win32) API, so we won't be using any old command prompt (As I think tutorials using the command prompt are quite hard to understand and pretty stale)

#1. Prerequisites:​

Before we can begin creating our first app, you'll need some software:

Microsoft Visual Studio Express 2012 (For Windows Desktop)

Windows 7 or 8 (For Windows Vista-, you can use Visual Studio 2010 or earlier!)

A cup of your favorite hot beverage

Some patience

and courage

Once you have acquired all of those, you can start download- and installing the software (All other prerequisites are provided in the package), this is where your hot beverage will come in handy (Alternatively, you can go for a nice cigarette or for a quick pop-down-the-shop).

I decided to create a series of videos on YouTube, for this thread.​

So, here we go, I guess :)

Episode 1; Performance Counters and Progress Bars:

[YOUTUBE]http://youtu.be/geePfZzjYCA[/YOUTUBE]

If the YouTube video is not visible/available, try watching it here: http://youtu.be/geePfZzjYCA

Episode 2; XDA-String-Loader:

[YOUTUBE]http://t.co/LO1q1jTIfE[/YOUTUBE]

If the video is unavailable, watch it here: http://t.co/LO1q1jTIfE
[Windows 8 Development and Hacking] Beatsleigher:
Downloads

Note: All downloads in this post are just VB source code. They are licensed under either GPL2.0 or GPL3.0 - So feel free to download, experiment and post what you've done!

GitHub Source Code Repositories: https://github.com/Beatsleigher/XDA_Visual_Basic_Tutorials/
[Windows 8 Development and Hacking] Beatsleigher:
Good Qs and As

This post is reserved for good questions and answers.​
[Windows 8 Development and Hacking] Beatsleigher:
User Contributions

This post is reserved for user contributions.​

Post your code and show the others what you have achieved!
[Windows 8 Development and Hacking] Beatsleigher:
Reserved..

--- Reserved ---
[Windows 8 Development and Hacking] Beatsleigher:
Reserved..

--- One more reserved post ---
[Windows 8 Development and Hacking] Useless guy:
I'm crying blood, sorry D:
[Windows 8 Development and Hacking] SixSixSevenSeven:
Yeah, you do kinda contradict yourself by calling it a native application and then using Visual Basic .NET (I must say, I have little faith in the tutorial being accurate if you cant even name the language properly). All .NET languages are run in a VM which by definition is not native :P I would hardly call it powerful either, it offers nothing that any other .NET language can't do faster and manages to **** things up in the process. Your statement about COM. Wtf??? VB.net makes COM access no easier or harder than anything else. The fact it is easy to access COM (which is something rarely used these days, although I do use it) is purely down to system.io.ports which is a generic .NET library and not a VB.net feature.

There is a good reason for command prompt based programs being the first step. They are simple. You dont have to worry about events and OOP programming early on. You can just sit down, learn wtf an integer is, bit of flow control and what iteration is etc.
[Windows 8 Development and Hacking] Useless guy:
And of course to use much simpler language, like Pascal. Console.ReadLine can confuse beginners.
[Windows 8 Development and Hacking] Beatsleigher:
Guys, maybe I... phrased things wrong.

It uses the .Net framework, but the language itself is native code.

The only things that run on top of the .Net FW are the new tools. Everything else is native code.

Whoops.
[Windows 8 Development and Hacking] SixSixSevenSeven:
you have just perfectly demonstrated that you don't have a clue what the .net framework is or how VB.net relates to it.

quick description of what really goes on when you hit F5 in visual studio (and for simplicities sake I am assuming we are in release mode not debug mode).

You hit f5.

The Visual Basic .net compiler analyses the source code, links it all up etc.

It then output MSIL. MicroSoft Intermediate Language.

The .NET framework is then a JIT dynamic recompiler (read, interpreter) which interprets the MSIL and executes the output.

It is not native code. The .NET framework is not just a set of tools.

only confusion which may arise is that .NET is now a part of the windows runtime, but it is not native any more than java is (same principal operation).
[Windows 8 Development and Hacking] GoodDayToDie:
JIT compilation != dynamic recompilation != interpretation. Please don't confuse them.

JIT compilation ("Just-In-Time", what .NET and Java do, as well as recent JavaScript engines) takes data that is *not* machine code (it can be a binary intermediate language, such as Java bytecode or .NET Common Intermediate Language ("MSIL" is obsolete; it's a public standard now), or it can be normal source code, such as JavaScript) and turns it into machine code immediately before the program runs. This introduces a delay at program startup, but thereafter the program runs almost as fast as it would if written in C and compiled directly to native code.

Dynamic recompilation takes machine code for one processor, generally already loaded into memory for execution, and translates it to machine code for a different processor before it is executed. The translated machine code is then stored back into memory so that the next time that code would be executed (for example, if it's in a loop or a function that is called multiple times) it doesn't need to be translated again. Dynamic recompilation operates on machine code, which (unlike intermediate language) is processor-specific and is not intended to be further compiled; this makes it significantly slower in most cases. It's largely replaced outright emulation (in which an entire CPU's state is modeled on some other CPU, and each instruction is run through the emulated CPU unmodified) as a way to execute a program written for one instruction set architecture on another ISA because it's faster than emulation, but it's still very slow.

Interpretation is like emulation, except it operates entirely on instructions which aren't machine code at all; you can write an interpreter for intermediate language (and that's basically how early versions of Java worked), but it's typically used for script languages (until recently, interpretation is how JavaScript was executed). An interpreter is a program that takes the interpreted language and figures out what it means in terms the CPU understands, then does that. For example, a CPU doesn't understand that "+" means addition; to a CPU, + is nothing except a number, just like any other ASCII character. It's up to an interpreter to recognize that + is supposed to be an operator, and that the 1 and 2 in 1+2 are supposed to be operands, and that they need to be converted from ASCII characters to the actual values 1 and 2 (which aren't even printable values in ASCII) and then to do the operation and store it somewhere. As you might expect, interpretation is *extremely* slow.
[Windows 8 Development and Hacking] squeezyb:
thanks for the videos. don't let the trolls get you down!
[Windows 8 Development and Hacking] Beatsleigher:
No worries, man :)

I tend to ignore such posts, as I don't see reason to argue :)

CyanogenModded Very China-like, from my Samsung Galaxy S III

LG Familyguy59/Beatsleigher
[Xperia Arc Q&A, Help & Troubleshooting] traingobonghp:
I want to flash kernel for my device rom cook JB, but i unknown any kernel best it, please help me! My English poor, tks
[Xperia Arc Q&A, Help & Troubleshooting] david azzz:
[3.x KERNELS] [ARC] 3.0.8-nAa-03 :)
[Xperia Arc Q&A, Help & Troubleshooting] TheHaso:
Theres 4 popular kernels

FXP

Fusion

Lupus

nAa-03

Also look at rom thread if a spesific kernel is suggested
[Xperia Arc Q&A, Help & Troubleshooting] traingobonghp:
please help me, I'm new member, can't post my question on other people's Thread, please Thanks
[Xperia Arc Q&A, Help & Troubleshooting] tangosierra_:
Flash the kernels and try them. Different people have different preferences so different kernels will suit them.

I personally prefer nAa because of the performance. But if you want battery life. nAa will not suit you, so its best you first hhand try them.
[Xperia Arc Q&A, Help & Troubleshooting] love4love:
Just Lupus

it's perfect
[Xperia Arc Q&A, Help & Troubleshooting] auni:
And to those who have replied. Guys please do not entertain this type of inquires, instead report the thread, so that MOD can close it.
[Xperia Arc Q&A, Help & Troubleshooting] The-Hulk:
Thread Closed, ^^^^^^^ this.
[LG Optimus 4X HD] UIQrules:
Or.. I've installed the usb driver package from LG. And I can go to the power off-> charger mode, and get contact with the "modem device", or whatever it is they're using, for a short while. But that won't help me get the bootloader unlock routine to work, it just gets stuck in "download mode!!!!", presumably because it needs to do some weird online routine as well, that I didn't know about, or it needs to download something via gprs, or ... and so on. And in phone mode, the serial number/device doesn't show up. (I tried removing the memory card, on the off chance that having the "mass driver" device turning up would mess something up, but no luck.

Anyway. So is there a trick here, to get adb to detect the devices, or to make the "modem device" mode have precedence, or something of that sort? I'm a bit reluctant to try disabling some of the devices, even if that would work, in case there's something else I don't know about being run half-way as well.. will the mode change on reboot, and I'll get stuck with a brick..?

Have anyone else had the same thing? I can run the pc-suite and the lg support tool just fine. But it seems that what happens is I'm able to have the adb tool detect the serial number for a very short time, and then it disappears and I can't connect to it again. Therefore, no bootloader unlock tool init..
[LG Optimus 4X HD] Omario-242:
I had the same problems back a while ago.

It got solved on the 262-000 Bootloader unlock thread.

I think you need the newest adb and fastboot drivers

and disable the modem in system settings of your pc,

but search for the mentioned thread and look it up there :)

Hope you get it working :)
[Samsung Galaxy SL i9003] acuicultor:
I opened this thread just for sharing this awesome app ( GREENIFY ). Its not my app i only want to share whith you, i9003 users, cuz we allways ran out of free ram.

With this awesome app we can decrease the ram comsumption of determinate installed apps,( you can install lots of apps and dont worry about ram ), i personally tested it and can say it works perfectly.

Here you got the link to the XDA ORIGINAL thread.

http://xdaforums.com/showthread.php?t=2155737

Please dont forget to hit the thanks button of the developer of this powerfull app.

I hope you enjoy the power of having a lot of free ram.
[Samsung Galaxy SL i9003] GuestK0094:
Thanks ! It's an awesome app effctively ;) Before using this app, I were around 330Mb used, with this app : 275Mb used ;)

It's great for playing or do multitasking on X-Gamerz ROM :)
[Samsung Galaxy SL i9003] acuicultor:
Im happy you enjoying your phone .
[Samsung Galaxy SL i9003] paboner:
Which system apps can be hibernated safely?

my normal running apps are already few but I want to hibernate some unnecessary system apps

Sent from my GT-I9003 -Xgamerz-
[Samsung Galaxy SL i9003] acuicultor:
Sorry man, i think you should ask this on the original thread to get a better answer. I only tell you: for do that you need the donation version.
[Samsung Galaxy SL i9003] mdaamir1989:
You can check your battery usage using the App called Better battery stats . Once you get to know the culprit ( wakelocks , battery eating apps ) those apps can be hibernated . Ex. I hibernate Maps , Google + etc ..
[Samsung Galaxy SL i9003] cukierkas:
it doesnt hipernate touchdown app :)

but anyway, superb app
[Samsung Galaxy SL i9003] ivAnash:
You cannot hibernate system apps using Greenify.. It can hibernate only downloaded apps.. .. Even apps that have been granted device admin status cannot be hibernated..

There is a feature which sends some kinda anonymous usage data via the greenify app.. Go to settings in the greenify app and turn it off..
[Samsung Galaxy SL i9003] acuicultor:
This is not true. With the donation version you can greenify some sistem apps. Just read the original thread and you will know how to do it.
[Samsung Galaxy SL i9003] ivAnash:
Yes u can with the donation version.. But it's still the beta test version..
[Samsung Galaxy SL i9003] ivAnash:
Have u tried the donation version.. Is it working with CM10..?? Have u been able to hibernate system apps..??
[Samsung Galaxy SL i9003] acuicultor:
Yes i use it and works flawesly on cm10 &cm10.1.

I hibernated about 6/7 system apps and no problem.

You need xposed installer.apk to install xposed framework to make greenify pro works correctly.
[Samsung Galaxy SL i9003] Ashish Lahare:
Which system apps are safe to hibernate... I want to hibernate most of the system apps .... so please suggest.....
[Samsung Galaxy SL i9003] acuicultor:
Dsp manager, play store,themes provider, facebook,media storage.... and what you want. If you notice a bad behavior on the phone only have to degreenify those sistem apps one by one, to know which shouldnt be greenified.
[Samsung Galaxy SL i9003] ivAnash:
How did u manage to greenify 'media storage'... It does not show up in the running apps or anything else..
[Samsung Galaxy SL i9003] acuicultor:
You have to install xposed installer.apk & greenify donation version.
[Samsung Galaxy SL i9003] ivAnash:
I've done that already. I have greenified quite a few system apps. But media storage, play store don't seem to appear in the list... And moreover when I try to greenify Play Store by using the search and then clicking on the notification.. It says system apps cannot be greenified..

Like I said, I have already greenified quite a few System apps.. But play store will not greenify..
[Samsung Galaxy SL i9003] acuicultor:
You have to push on "insist" button.
[Samsung Galaxy SL i9003] ivAnash:
Check out the 1st screenshot.. I have greenified system apps, so I know what the 'insist' button does..

Check the second screenshot. When I try to greenify Play Store there is no insist option.. That's what I am confused abt..
[Samsung Galaxy SL i9003] BHDR:
Good app. Thank you!
[Samsung Galaxy SL i9003] Ashish Lahare:
Try to clear data of greenify... check xposed framework is proper and try

again....:)
[Samsung Galaxy SL i9003] acuicultor:
I never saw that window. What version of greenify and greenify donation you use? May be you have to upgrade to latest versions to be able to do that.
[Samsung Galaxy SL i9003] acuicultor:
This happens to me when try to greenify every sistem app.
[Samsung Galaxy SL i9003] ivAnash:
K.. Maybe it's because I'm using the market version 1.82.... I tried to install the beta version.. Joined the "Greenify" community and tried to install. But it still won't.. So can u please upload the greenify free version apk, the one ur using.. I'll use that until I figure out a way to get one myself...
[Samsung Galaxy SL i9003] acuicultor:
Sorry man, cant mirror the app per dev. decision. He told :"dont mirror my app" on the original thread, so i think you can download it from google or just ask for it on Greenify thread.

Good luck!!
[Samsung Galaxy SL i9003] ivAnash:
Never mind... It worked the 2nd time.. Had been using the wrong Gmail account .. Its workin now.. Thanks for the help..
[Samsung Galaxy SL i9003] maeysam:
Hi...

Hi I have on problem whit this app after I freez app work with network for example download manager download is stop after I defrezz app It's work right is this problem is bug?

Sory for my bad english
[Samsung Galaxy SL i9003] acuicultor:
It is normal behavior of the app. If you greenify an app when screen is off that app is stopped.
[Samsung Galaxy SL i9003] maeysam:
ok!

Ok very good thank....
[Samsung Galaxy SL i9003] resetez:
I love this app ! Thank you.
[Samsung Galaxy SL i9003] pp.parthiban:
Thanks

Thanks for the information about useful app.
[Samsung Galaxy SL i9003] acuicultor:
You're wellcome
[Samsung Galaxy SL i9003] Ashish Lahare:
Amazing app.... I have greenified many system apps.... but when I take picture , after pressing capture button , gallery force closes..... and camera closes .. then I have degreenified gallery and media storage and rebooted and camera started working but after few minutes again it doesn't take picture and gallery force closes..... ANY SOLUTION....:)
[Samsung Galaxy SL i9003] saywhatt:
I suggest you NOT GREENIFY critical system apps. Allthough you may greenify system apps such as G+ and etc with the help of of the Xposed Framework.
[Samsung Galaxy SL i9003] ivAnash:
Gallery force closing has nothing to do with Greenify.. Its a common issue if u are using the latest gallery apk ie the one with panorama shot option..

Instead use the ics version of gallery apk.. Camera or video recording does not force close in that..
[AT&T, Rogers HTC One X, Telstra One XL] al_g:
Not sure when USB stopped working but nothing I've done let's my HTC One X (AT&T) connect via usb. I'm running CM10.1 and have tried both MTP and USB Storage and none of my PC's will see my phone.

I'm running TWRP 2.5, which I just updated today. When I boot into recovery and mount USB, my PC shows nothing. I boot the phone into recovery and the fastboot line says fastboot AC instead of fastboot USB. I've tried 3 different cables, an older cable that came with a MyTouch 4G, the HOX cable, and a generic USB cable. All three cables work with my wife's HOX, though hers is stock.

I've also tried on two different laptops (one vista, one win7), my PC (win7), even ran an Ubuntu VM on my PC and nothing.

HTC Sync Manager has been installed and is currently uninstalled though I do see the HTC Driver in Programs so it is there. Some times when I plug the phone in I get an error from Windows about the USB device not installing right. One odd thing is I don't see the device anywhere in device manager, nothing other Other, Android Devices or anything like that.

Developer options are turned on, with Android debugging, USB debugging notify turned on. Root access is set to Apps and ADB.

I've tried other things I've found such as turning the phone off and plugging it into the USB and letting windows detect that way. Pretty much at a loss at this point.
[AT&T, Rogers HTC One X, Telstra One XL] exad:
Helping a gentleman with the same issue in another thread, it sounds to me like a hardware issue.
[Sprint Samsung Galaxy S III] Lancerz:
Trying to see if it's their servers. I saw a post today so I checked mine and sure enough I had a error also.
[Sprint Samsung Galaxy S III] TheSocalGuy79:
My Gmail has been having issues today.

Sent from my Freeza MD4 Stock Rooted Galaxy S3
[Sprint Samsung Galaxy S III] metalfan78:
It happens to me about once a week. A reboot usually forces everything to sync. It's a little annoying.
[Sprint Samsung Galaxy S III] Lancerz:
In your menu>settings>accounts>google are you showing a red circle with the syncing error message?
[Sprint Samsung Galaxy S III] CNexus:
No issues here
[Sprint Samsung Galaxy S III] metalfan78:
Yea, every time. Not sure if its where I work that does it or its just a brainfart.
[Sprint Samsung Galaxy S III] toolegit:
Had a sync error, forcing sync now cleared it. For now....
[Sprint Samsung Galaxy S III] Lancerz:
I removed my account and re added it and now everything is syncing fine.
[Sprint Samsung Galaxy S III] HashTagHell:
Had the same issue twice over the past two days. Quite annoying.
[Sprint Samsung Galaxy S III] metalfan78:
3 times for me today, very frustrating
[Sprint Samsung Galaxy S III] arkgrotto811:
I've been having this same problem. thought it may be the rom I'm on (Liquid Smooth 2.3), but apparently its happening all over. It has happened to me about 4 times this week.
[AT&T, Rogers, Bell, Telus Samsung Galaxy S III] Funkadelick:
Can anyone tell me why it takes so long to recharge my phone ?

I use a charger cable from my computer (usb) to phone while at work --- then I also use it at home too.

Is it only the wall charger that does it fast ? not USB/laptop/computer ?

Last night it took me 10 hours (phone was on but I didn't touch it for 10 hours - internet/wifi/3g was OFF)

why does it take 10 hours ?

Is something wrong with the phone? battery? or is it the charger ?
[AT&T, Rogers, Bell, Telus Samsung Galaxy S III] d3athsd00r:
USB only has a small amount of current that goes through it. Enough to power small USB devices and no more. I believe it's around 500mAH. But your phone is always drawing power, so the excess is what actually charges your battery. Your wall charger is 1000mAH which means there is plenty of current to charge your battery even with heavy usage.

Tl;dr: USB is weak and 10hrs is normal. Wall charger is much more powerful and faster.
[AT&T, Rogers, Bell, Telus Samsung Galaxy S III] Funkadelick:
damn thanks for the great reply.

Further more, I was at my friends house once, and he has a black berry (same charger as my SGS3) and he passed me this cord to charge and it honestly charged the entire phone from 5% to 90% in like less than an hour...

not sure wtf this was but is it possible ? is it bad for the phone ? for the battery ?
[AT&T, Rogers, Bell, Telus Samsung Galaxy S III] xBeerdroiDx:
10 hours is not normal. And the average wall charger that comes with your phone is 750mAH, not 1000. The 1000mAH chargers are quick charge ones.

The fact that the blackberry charger worked well on your S3 tells me that you should get a new charger.
[AT&T, Rogers, Bell, Telus Samsung Galaxy S III] Funkadelick:
where does one find one of the quick chargers to buy ? (1000mAH)
[AT&T, Rogers, Bell, Telus Samsung Galaxy S III] xBeerdroiDx:
you can find all sorts of chargers on amazon. you can find inexpensive ones at walmart too. i would recommend buying a samsung charger for your samsung phone. hold onto the one that came with your S3, even if it takes forever to charge. just use it to connect to your pc for file transferring, odin, etc.
[AT&T, Rogers, Bell, Telus Samsung Galaxy S III] MikeKudos:
Even though charging quickly seems good but if you can afford the time then use the one you already have z charging too quickly affects your battery health negatively , a slow charger will make sure your battery stays healthy for a long time , mind it by slow I mean a 750 mAH one not a faulty one :P in case yours is faulty .
[AT&T, Rogers, Bell, Telus Samsung Galaxy S III] d3athsd00r:
The S3 charger is 1000mAH. I have two of them that came with my phones. And anytime I connect my phone to my computer I can leave it connected for hours and only charge a few percent. This phone just draws a lot of power.
[AT&T, Rogers, Bell, Telus Samsung Galaxy S III] xBeerdroiDx:
thats interesting because i have 4 samsung chargers. 2 came with my old S2's and 2 came with my 2 S3's. the output on all 4 is 700mAH. i got robbed. of course, connected to a PC the output is max 500. even at that, i still get a better charge than a few percent when connected to a PC for hours.
[AT&T Samsung Galaxy S 4 Q&A, Help & Troubleshootin] geoldr:
Hey guys is it just my device or does the browser not go fullscreen? It did on my s3. And every other samsung app even music for some reason goes fullscreen. Is there a way to at least hide the nav bar?
[AT&T Samsung Galaxy S 4 Q&A, Help & Troubleshootin] mcmb03:
In the browser, go to Settings -> Accessibility then check the option for full screen :) :good: