我刚刚注册了Firebase,并创建了一个新项目.Firebase问我的app域和SHA1调试密钥.我输入了这些详细信息,并生成了一个google-services.json文件供我添加到我的应用模块的根目录中.
我的问题是,这个.json文件是否应该添加到公共(开源)存储库中.它应该是秘密的东西,比如API密钥吗?
我正在努力为学校写一个程序.分配是循环并要求用户输入文件.当找不到文件或者用户退出循环时(在我的情况下,他们点击joptionpane上的取消)输出每个文件的数据.到目前为止这是我的代码:
/**
* @param args
*/
public static void main(String[] args) {
// Lists to hold file data
List<String> fileNames = new ArrayList<String>();
List<Integer> numChars = new ArrayList<Integer>();
List<Integer> numWords = new ArrayList<Integer>();
List<Integer> numLines = new ArrayList<Integer>();
String inFile;
while ( (inFile = JOptionPane.showInputDialog("Enter a file name:")) != null) {
// Create new file object instance
File file = new File(inFile);
try {
fileNames.add(inFile); // File name as a string
// Pass file objects
numChars.add( getNumChars(file));
numWords.add( getNumWords(file));
numLines.add( …Run Code Online (Sandbox Code Playgroud)