Posts by Paulo Rodrigues • 6,280 points
201 posts
-
1
votes1
answer640
viewsA: modify notification icon
As for the size of the icon, you can add this to your notificationBuilder: .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher)) And to vibrate when the notification…
-
0
votes1
answer24
viewsA: How to enter a specific date in the Swift3 Calendar?
First you need the separate components using DateComponents: var dateComponents = DateComponents() dateComponents.year = 2017 dateComponents.month = 5 dateComponents.day = 20 Hence you can set a…
-
4
votes1
answer520
viewsQ: Diagram of responsive hexagons
I found a code that assembles a set of hexagons (like a beehive) in a way that is responsive. I’ve made some adaptations to suit my purpose as a result, which is not exactly a grid. I simply added a…
-
2
votes2
answers340
viewsA: Swift - how to find out the size of JSON?
If I understand correctly, you want to iterate on the object json and add to the vector img, right? Considering that, you do so: var img: [String] = [] for (index, subJson) : (String, JSON) in json…
-
0
votes1
answer131
viewsA: Problem using cakephp 2.6 - Undefined index
Let’s see some points: Every reference to his model should be done in the singular by cakephp convention. Some places you should fix: In the model Loja: public $hasOne = array('Recibo'); In the…
-
2
votes1
answer32
viewsA: Return tables with hasMany - Cakephp
You can hide the display of this field by adding it to the property _hidden of its entity, thus: protected $_hidden = ['_joinData'];…
cakephpanswered Paulo Rodrigues 6,280 -
3
votes2
answers89
viewsA: How to read a txt file store the value in the whole type?
You can try something like this on your while: while ((linha = bufferedReader.readLine()) != null) { if (linha.startsWith("R.drawble.")) { String name = linha.replace("R.drawble.", ""); int resource…
-
1
votes1
answer33
viewsA: Disable Fabric Answer
Apparently there is no way you can completely disable the Answers, based in this discussion in the community of Twitter. Note that as mentioned by the member of staff, Fabric now has two separate…
-
2
votes1
answer105
viewsA: Your binary does not support iPad
In fact, by the settings you presented, there is no support even for iPad, according to the target-device, is only compatible with Handset. If you want to make it universal, change to:…
-
1
votes1
answer318
viewsA: IOS - How to program navigation between Viewcontroller in Objective-C?
You can use the methods pushViewController: or presentViewController:. First you need to get an instance of your UIViewController which will be opened and which is in the storyboard through the…
-
0
votes3
answers301
viewsA: Sort query with cakephp paginate 3.0
When using contain, the Cakephp performs several darlings, as many as are included. Then you cannot perform conditions, sort, group and etc in your main class from the contain. So if your class that…
-
3
votes1
answer77
viewsA: Alamofire 3 how to pick up errors if they exist in the call to the service(Swift2)
The mistake was just in the completionHandler of the method responseJSON. It should look something like this: Alamofire.request(.GET, url, parameters: ["foo": "bar"]).responseJSON { response in…
-
2
votes1
answer50
viewsA: How do I get a JSON and store in a list?
First you need to convert this string for a NSData: NSData *data = [json dataUsingEncoding:NSUTF8StringEncoding]; And then, for a NSArray, which is a list of NSDictionary: NSError *error; NSArray…
-
3
votes1
answer1066
viewsA: How to create a button in the google maps API to add a bookmark?
Basically, what you want then is how to get your current location and keep it always updates, since the way to add the marker you already have, right? The recommendation is to use the…
-
0
votes1
answer1443
viewsA: Error: Jsonexception: End of input at Character 0, when sending Android information to a PHP Webservice
You need to encode before sending any string with special characters through your JSON. Try using the class URLEncoder, something like that: String nome = URLEncoder.encode("áàâãõóòúç", "utf-8");…
-
0
votes3
answers119
viewsA: Migrate JSON request from android to Swift
Try something like that: let userPasswordString = "\(mUser):\(mPassword)" let userPasswordData = userPasswordString.dataUsingEncoding(NSUTF8StringEncoding) let base64EncodedCredential =…
-
3
votes2
answers223
viewsA: How to feed a tableView from a screen with information from another screen?
Using protocol, as mentioned, you can do this as follows: the protocol definition will be in your class ResumoViewController, this one I’ll call ResumoDelegate. In this protocol I will define a…
-
2
votes1
answer99
viewsA: Request for slow scrolling json for tableview
In fact you will need to asynchronously download this image so that it does not give these locked in your table. Start with something like this: if let imageUrl = NSURL(string:…
-
1
votes1
answer80
viewsA: Traversing String html
If at all times you are using way relative, as in your example, and based on this address http, you can use the method loadDataWithBaseURL. It goes like this:…
-
1
votes1
answer46
viewsQ: Same numbers in the key-value pair of an array, but random
Assuming I have one array in this way: array(10, 11, 12, 13, 14, 15) I’m trying to make a way to get as a result, a array with key-value pairs, but randomly without pairs being equal. For example:…
-
4
votes1
answer1241
viewsA: Customize android webView error page
You didn’t mention it, but supposing you have a class Functions with a static method to check the internet connection, thus: public static boolean isDeviceOnline(Context pContext) {…
-
3
votes1
answer294
viewsA: Search query in cakephp
What happens is that you got the values of the second parameter wrong. The method find() wait as second parameter one array with one or more of the following keys: 'conditions', 'limit',…
cakephpanswered Paulo Rodrigues 6,280 -
2
votes1
answer411
viewsA: Check Internet access
Assuming you have a class for useful methods for static access, it would be more or less like a class Functions.swift: import SystemConfiguration struct Functions { static func…
-
2
votes1
answer76
viewsA: Textview with dynamic height
Once you define the delegate in the header of your class: class TesteViewController: UIViewController, UITextViewDelegate { Then you implement the two methods below, being that the textViewDidChange…
-
1
votes2
answers212
viewsA: Close webView page after loading
First, add to your header file .h the class delegate concerning the UIWebView: @interface WebViewController : UIViewController <UIWebViewDelegate> And so, in the implementation define the…
-
1
votes1
answer37
viewsA: Uipicker view of array
Since you already have the UIPickerView set and with the appropriate values, to get who is selected, if you only have a component, do so: let selecionado: Int = pickerView.selectedRowInComponent(0)…
-
2
votes2
answers993
viewsA: How to get data from a text displayed in the dialog
Your Fragment you have already "inflated" and is set, just then you search and define the elements through the Ids, and in the action of the positive button seek its values: View view =…
-
2
votes1
answer905
viewsA: Beta iOS App with Testflight
Need to submit to Apple Store to release beta? It is not necessary, they are two different processes, because you will want to really test before sending a final version to the store. Then you can…
-
3
votes1
answer48
viewsA: Know which button invoked the action
Once you set the two buttons: @IBOutlet weak var btnPrimeiro: UIButton! @IBOutlet weak var btnSegundo: UIButton! Your action in fact may be only one for N buttons. This action takes the button…
-
1
votes1
answer53
viewsA: Image with zoom option or image-based map view
My answer goes to the second option, because I don’t know if with the MKMapKit you can do this. What you need, basically, is to put a UIImageView in a UIScrollView. If using the Builder interface…
-
2
votes4
answers2456
viewsA: Set coordinates when opening map
To open the Google Maps directly from your application with a certain coordinate, using Intent even, for example. Intent intent = new Intent(Intent.ACTION_VIEW,…
-
0
votes1
answer81
viewsA: How to update Uitableview with two-dimensional array?
Having a array of Dicties, as is the case that you exemplified, just do something like this: func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return…
-
3
votes1
answer80
viewsA: Error Cannot invoke initialize for type "Cllocationcordinate2d" with an argument list of type "latitude : String"
What happens is you’re going through one String and the expected values in the parameters latitude and longitude is a double. In this case, you need to convert these variables first, for example:…
-
1
votes2
answers58
viewsA: Find birthday girls of the month
Try to make the condition only with the month, so: $condicoes['conditions'] = array( "Funcionario.SitAfa <>" => 7, "DATE_FORMAT(Funcionario.datNasc, '%m') = DATE_FORMAT(NOW(), '%m')" );…
-
0
votes2
answers1368
viewsA: How to get the coordinates (X and Y) of a click on an imageview?
Also try to get the coordinates from the top left corner of your image, so you will have the exact reference: int[] viewCoords = new int[2]; imgView.getLocationOnScreen(viewCoords); And then, in the…
-
1
votes0
answers259
viewsQ: Apparatus standard notification ringtone
In my application I have in the settings an option for the user to select the sound that will run when receiving notification. Then I open one AlertDialog and list the standard ringtone of the…
androidasked Paulo Rodrigues 6,280 -
0
votes1
answer46
viewsA: Basic authentication using Afnetworking
As well as other publications found here, the request is very similar. You will only need to add in requestSerializer authentication data using the method setAuthorizationHeaderFieldWithUsername. In…
-
0
votes1
answer216
viewsA: How to use Last.fm API?
Ismael, what you need basically is to perform requisitions for the API which can be done easily using NSURL, NSURLRequest and NSURLSession. These three are preferably from the iOS 7, otherwise there…
-
2
votes1
answer58
viewsA: How to use didSelectRowAtIndex?
Eduardo, it’s very simple but it also depends on how your structure is. The way you explained it is pretty shallow, so I’m gonna make some assumptions. To do this, all you have to do is identify…
-
1
votes1
answer53
viewsA: How to work with Uilongpressgesturerecognizer on Swift using tables?
It is necessary to add the gesture in the cell itself, inside the cellForRowAtIndexPath, for example: override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath)…
-
1
votes1
answer174
viewsA: How do I open a Viewcontroller via Local Notification?
In the iOS you don’t open a view directly (as can be done in Android) and yes the application is opened to then open the screen you want. This is all done in your Appdelegate, sort of like this: In…
-
3
votes1
answer250
viewsA: Execute a method with the closed application "Service"
Depends on what you mean by "time to time". In fact on iOS does not have all this freedom that exists on Android. There are Background Modes (see table 3-1), each for a specific need. I believe the…
-
1
votes1
answer33
viewsA: Update Annotations
It is only being updated when it opens because you are getting the location by the method startUpdatingLocation() and consequently its method of displayLocationInfo() in the viewDidLoad(). To call…
-
2
votes1
answer165
viewsA: GPS on Android - Map=null
Your object map you only need to get it once in this class, no need to search for it every time, every iteration of students and etc. Maybe because it is out of context, when you run the method…
-
2
votes1
answer73
viewsA: Method call within a class
From what I understand of your question and according to the comments, I believe that the solution can be well simplified using the class itself String. Try something like that: first =…
javaanswered Paulo Rodrigues 6,280 -
3
votes1
answer1453
viewsA: How to validate a zip code on Android?
First, to be clear API that you reported is not official Post office. This was a well-discussed subject here and here on an efficient way to obtain this data. Now, if you really want to use the…
-
0
votes1
answer245
viewsA: How to show Facebook friends list on Ios with Swift
From the Graph API 2.0, the full list of friends is no longer allowed by default in authentication and only returns friends who have authorized, ie those who also own your application. So, first of…
-
2
votes1
answer205
viewsA: Error handling in Google maps Android API
Like your method getCoordenada already returns a null value if you do not find the given address, just do a check before using a coordinate to define a location, regardless of where it is. More or…
-
1
votes1
answer92
viewsA: Uitextfield does not display keyboard (IOS / Objective C)
In the simulator, immediately you can use Command + k to show or hide the keyboard. By default it comes hidden because the option Connect Hardware Keyboard on the menu Hardware > Keyboard is…
-
1
votes1
answer475
viewsA: How to add the address to the infowindow Gmaps v3?
You need basically three steps. First, start the classes InfoWindow to the balloon and Geocoder to search the address from the coordinates: var infoWindow = new google.maps.InfoWindow(); var…