Android Open Source - MobileCodeGenerator I O S Java Util






From Project

Back to project page MobileCodeGenerator.

License

The source code is released under:

GNU General Public License

If you think the Android project MobileCodeGenerator listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/************************************************************************************************************************
 * Copyright 2013 Gregorio Perego, Stefania Pezzetti
 * This file is part of it.polimi.mobilecodegenerator.
 * /*from  w  ww .j  a  v a  2s.c  om*/
 * it.polimi.mobilecodegenerator is free software: 
 * you can redistribute it and/or modify it under the terms of the 
 * GNU General Public License as published by the Free Software Foundation, 
 * either version 3 of the License, or (at your option) any later version.
 * 
 * it.polimi.mobilecodegenerator is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
 * See the GNU General Public License for more details.You should have received a copy of the GNU General Public License
 * along with it.polimi.mobilecodegenerator. If not, see <http://www.gnu.org/licenses/>
 * ***********************************************************************************************************************/

package ios_extensions;

import java.io.File;
import java.util.HashMap;

import app_extensions.AppJavaUtil;

public class IOSJavaUtil {
  
  private static HashMap<String, String[]> hexadecimalIdsMap = new HashMap<String, String[]>();
  private static int count = 1000000;
  public static String getFirstHexadecimalId(String key){
    if(hexadecimalIdsMap.containsKey(key)){
      return hexadecimalIdsMap.get(key)[0];    
    }
    else{
      return generateNewHexadecimalIds(key)[0];
    }
  }
  public static String getSecondHexadecimalId(String key){
    return hexadecimalIdsMap.get(key)[1];
  }
  private static String[] generateNewHexadecimalIds(String key) {
    String firstId = "7F918D"+(++count)+"EF10055FE15";
    String secondId = "7F918D"+(++count)+"EF10055FE15";
    String[] array = {firstId,secondId};
    hexadecimalIdsMap.put(key,array);
    return array;
  }
  
  //delete application code folder and its content (if already exists)
  public static void deleteApplicationFolder(){
    File iosAppFolder = new File(IOSConstants.destinationFilesFolder);
    AppJavaUtil.deleteFolder(iosAppFolder);
  }
  
  public static void copyUserFiles(){
    File folder = new File("utils/user_files");
    for(File source : folder.listFiles()){
      File destination = new File(IOSConstants.destinationFilesFolder+"/"+AppJavaUtil.APPLICATION_NAME+"/"+source.getName());
      AppJavaUtil.copyFile(source, destination);
    }
  }
  
  public static void copyDefaultIOSFiles(){
    new File(IOSConstants.destinationFilesFolder+"/"+AppJavaUtil.APPLICATION_NAME+"/en.lproj").mkdirs();
    
    for(int i=0; i<IOSConstants.sourceFilesPaths.length; i++){
      File source = new File(IOSConstants.sourceFilesPaths[i]);
      File destination = new File(IOSConstants.destinationFilesPaths[i]);
      AppJavaUtil.copyFile(source, destination);
    }
  }
  
  private static Integer currentY;
  private static final Integer Y_OFFSET = 10;
  
  public static void resetCurrentY(){
    currentY = 20;
  }
  
  public static Integer getYOnStoryboard(Integer height){
    Integer y = currentY;
    currentY = currentY + height + Y_OFFSET;
    return y;
  }
}




Java Source Code List

android_extensions.AndroidConstants.java
android_extensions.AndroidJavaUtil.java
app_extensions.AppJavaUtil.java
ios_extensions.IOSConstants.java
ios_extensions.IOSJavaUtil.java
it.polimi.multimedia.AudioListActivity.java
it.polimi.multimedia.AudioListActivity.java
it.polimi.multimedia.AudioPlayerActivity.java
it.polimi.multimedia.AudioPlayerActivity.java
it.polimi.multimedia.AudioRecorderActivity.java
it.polimi.multimedia.AudioRecorderActivity.java
it.polimi.multimedia.GalleryActivity.java
it.polimi.multimedia.GalleryActivity.java
it.polimi.multimedia.MenuActivity.java
it.polimi.multimedia.MenuActivity.java
it.polimi.multimedia.PhotoGridActivity.java
it.polimi.multimedia.PhotoGridActivity.java
it.polimi.multimedia.PhotoViewerActivity.java
it.polimi.multimedia.PhotoViewerActivity.java
it.polimi.multimedia.PhotocameraActivity.java
it.polimi.multimedia.PhotocameraActivity.java
it.polimi.multimedia.Utils.java
it.polimi.multimedia.Utils.java
it.polimi.multimedia.VideoListActivity.java
it.polimi.multimedia.VideoListActivity.java
it.polimi.multimedia.VideoViewerActivity.java
it.polimi.multimedia.VideoViewerActivity.java
it.polimi.multimedia.VideocameraActivity.java
it.polimi.multimedia.VideocameraActivity.java
it.polimi.promemoria.HomeActivity.java
it.polimi.promemoria.NoteDetailActivity.java
it.polimi.promemoria.NotesListActivity.java
it.polimi.promemoria.Utils.java
it.polimi.valtellina.DescriptionActivity.java
it.polimi.valtellina.DescriptionActivity.java
it.polimi.valtellina.ImageDownloadingTask.java
it.polimi.valtellina.ImageDownloadingTask.java
it.polimi.valtellina.MenuActivity.java
it.polimi.valtellina.MenuActivity.java
it.polimi.valtellina.TurismLocationDetailActivity.java
it.polimi.valtellina.TurismLocationDetailActivity.java
it.polimi.valtellina.TurismLocationsListActivity.java
it.polimi.valtellina.TurismLocationsListActivity.java
it.polimi.valtellina.Utils.java
it.polimi.valtellina.Utils.java
it.polimi.valtellina.VideoActivity.java
it.polimi.valtellina.VideoActivity.java
model_checks.JavaChecks.java