iOS & Android Development

Previous topic - Next topic

matchy

Quote from: kanonet on 2013-Feb-19
Quote from: coder14 on 2013-Feb-19Time for you to become invisible again.
Made my day!
Now you see me...  :puke: .. now you don't

MrTAToad

There are a few bits about for accessing iOS stuff around - and possibly for Android too.  I suspect you'll need to search around for it though.

Kitty Hello

I think your expectations are too high. What you want to do is very sophisticated stuff. Sure, if someone writes a library that solves your special problem, its easy. But that is what codig is about. It's reading other code and trying to understand it and then change and extend it to your needs. I think you should start smaller.
Or give exact requirements (what platform, what do you want to access and why). Many problems can be solved a lot easier when we know your background.

jSmith

How can I include the iPhone date picker controller into one of my GLB apps? I found this sample which is supposed to display the date picker and I think some other stuff:

Code (glbasic) Select
#import "ViewController.h"
#import "ViewController2.h"



@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
   
    self.countryNames = @[@"Australia",@"China",@"France",@"Great Britain", @"Japan"];
    self.exchangeRates = @[ @0.9922f, @6.5938f, @0.7270f, @0.6206f, @81.57f ];
   
    UIBarButtonItem *nextBarItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFastForward target:self action:@selector(cmdNext_Tapped:)];
   
    self.navigationItem.rightBarButtonItem = nextBarItem;
}


-(IBAction)cmdNext_Tapped:(UIBarButtonItem *)sender{
    ViewController2 *viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"ViewController2"];
   
    [self.navigationController pushViewController:viewController animated:YES];
}

-(void) viewWillAppear:(BOOL)animated{
   
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - PickerView DataSource

- (NSInteger) numberOfComponentsInPickerView:(UIPickerView *)pickerView{
    return 1;
}

- (NSInteger) pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{
   
    //if (component==0) {
    //   return 1;
    //}else
   
    return [self.countryNames count];
}

- (NSString *) pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component{
    return self.countryNames [row];
}

-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
    float rate = [self.exchangeRates[row] floatValue];
    float dollars = [self.txtInput.text floatValue];
    float result = dollars * rate;
   
    NSString *resultString = [[NSString alloc] initWithFormat: @"%.2f USD = %.2f %@", dollars, result,
                          self.countryNames[row]];
    self.myLabel.text= resultString;

}

- (IBAction)txtFieldReturn:(UITextField *)sender {
    [sender resignFirstResponder];
}
@end


Can this be made into a GLB wrapper? There are also many other files in the project like AppDelegate, some .h and .m and .pch files.
When your software fails blame it on the hardware.

Ian Price

There's nothing obvious in that code that speaks of dates - seems to be country & currency based. Perhaps it's using a rolling/kinetic display like a date picker, so you can replace that data? Dunno.

Anyway, I presume you mean something like this -


Could you not use simple arrays within GLB code and sprites to re-create/emulate that? You could then use the data without diving into XCode etc.
I came. I saw. I played.

spacefractal

#20
http://www.glbasic.com/forum/index.php?topic=8660.0 is a example to import functions to integrate iCloud. Im guess its similar here (a hint to Coder14) how to import c code (which is here glBasic is excellent when those basic commands came to short sometimes).

Im wonder too why he asked the same thing again and again, and what glbasic can and not can, and have not researched very much? Glbasic is not designed to integrate with all hardware, but was more designed as a simple language with platform compatible in mind. Glbasic can do extends with inline, which is what im like Glbasic, even there would been no basic anymore. Im personly would also access camera too, but Glbasic could not do that, so im used BlitzMax instead.

PS. I have to say im for some years ago got banned in BlitzMax for a similar reason, which was property my own fault (there was some negative post, and im stupid used some %¤& words). But oh well, its was just a few days and did apologize soon after. So Im thinks its same here? So give him a change too as me thinks he will learn from that. Also here too, im did clash Spicypixel too with a dumb post, but we did apologize together, so no problems.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

bigsofty

One of GLBasic strengths is that it is a Basic language with no limitations, if you need something, no matter how low-level or on what supported platform, there is always the option of a small C patch. It's not a matter of what it can't do, it's only a matter of how hard it is to do.
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

matchy

Quote from: jSmith on 2013-Mar-19
Can this be made into a GLB wrapper? There are also many other files in the project like AppDelegate, some .h and .m and .pch files.

As a developer, no because it's a trick question. As a programmer, sure. Create a hello world wrapper and get back to me!

jSmith

@Ian: That was just an example. If I can see how to make such a routine into a wrapper then maybe I could try to apply the same method to other Obj-C code.

@bigsofty: It seems that the level of difficulty for this is quite high.

@matchy: If you show me how to create a wrapper maybe I can create a Hello World one.
When your software fails blame it on the hardware.


jSmith

When your software fails blame it on the hardware.

jSmith

IRONY! I've been reading up a whole lot on Obj-C, and believe it or not, I am now able to write simple apps in XCode!!!  :enc:

The darn OO syntax still baffles me somewhat, but there are TONS of ready examples for the taking. It even supports OpenGL directly, and I was able to run the MoveMe example on the emulator. And the Interface Builder is WOW Easy! And it's ALL FREE! :booze:

Does anyone else have any hands-on experience with XCode/Objective-C?
When your software fails blame it on the hardware.

matchy

Sounds good jSmith. For me, simple Youtube tutorials helped a lot in the starting out.

r0ber7

Quote from: jSmith on 2013-Apr-16
IRONY! I've been reading up a whole lot on Obj-C, and believe it or not, I am now able to write simple apps in XCode!!!  :enc:

The darn OO syntax still baffles me somewhat, but there are TONS of ready examples for the taking. It even supports OpenGL directly, and I was able to run the MoveMe example on the emulator. And the Interface Builder is WOW Easy! And it's ALL FREE! :booze:

Does anyone else have any hands-on experience with XCode/Objective-C?

I just got finished writing an example app for a client, which uses the camera & keyboard. XCode is pretty damn good once you get used to it. I had trouble with [[this]] too at first, but now I'm pretty much used to it. I knew C before this, just not ObjC. Turns out it's pretty similar. :) If I get stuck, Stackoverflow basically answers all my XCode questions.  :good:

jSmith

Quote from: r0ber7 on 2013-Apr-27XCode is pretty damn good once you get used to it. I had trouble with [[this]] too at first, but now I'm pretty much used to it.
You took the words right out of my mouth. At first, Apple's Obj-C tutorials confused me with terms like sending/receiving messages to/from classes, but all the those square brackets simply nest multiple function calls within a single line - something that I've done many times in BASIC. Plus, it's so easy to learn when there are tons of ready, working examples. I'm currently studying their OpenGL system, and by simply clicking the OpenGL Game template in XCode's new project window, you instantly get a WORKING MODEL of an OpenGL animation app!

And if ever we get stuck:
Quote from: r0ber7 on 2013-Apr-27...Stackoverflow basically answers all my XCode questions.  :good:
That's a buzzing forum with real experts.  :enc:

When your software fails blame it on the hardware.